BTW the concatenation function you suggest works nicely except that as you noted, it concatenates in an unpredictable order, so I'm now trying to solve that problem.

memo_id | sequence | memo_text --------------------------------------- 666 | 1 | The quick 666 | 2 | red fox 666 | 3 | jumped over 666 | 4 | the lazy brown dog


You have :

SELECT your_concat( memo_text ) FROM table GROUP BY memo_id

You can use :

SELECT your_concat( memo_text ) FROM
(SELECT memo_id, sequence, memo_text FROM table ORDER BY memo_id, sequence OFFSET 0) AS foo
GROUP BY memo_id


the OFFSET 0 may be necessary (or not). Try it !


---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Reply via email to