Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 21st, 2012  |  syntax: None  |  size: 0.52 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. SELECT DISTINCT ON (ra.release)
  2.          created.created, annotation_append(annotation.text)
  3.     FROM annotation,
  4.          (
  5.               SELECT created
  6.                 FROM annotation an
  7.                 JOIN release_annotation ra ON ra.annotation = an.id
  8.                WHERE ra.release IN (14540, 14541, 14542)
  9.          ) created,
  10.          release_annotation ra
  11.    WHERE ra.annotation = annotation.id
  12.      AND annotation.created <= created.created
  13.      AND ra.release IN (14540,14541,14542)
  14. GROUP BY created.created;