[HACKERS] Is this possible? concatenating results from a subquery

2004-04-26 Thread Erwin Moller
Hi! I face the following problem: 2 tables: tblperson and tblnotes tblperson: colums: personid (PK), name tblnotes: colums: noteid(PK), personid(references tblperson(personid)), note tblnotes has notes stored written by a person from tblperson identified (FK) by its personid. I make a select o

Re: [HACKERS] Is this possible? concatenating results from a subquery

2004-04-26 Thread Erwin Moller
Thanks Janko! I was hoping for a query-only solution (SQL only), but this will work just great. :-) If I switch database this code will give me some trouble. I guess I'll have to stick to Postgresql. ;-) Thanks. Regards, Erwin Moller Janko Richter wrote: > Perhaps this helps: > > CREATE

Re: [HACKERS] Is this possible? concatenating results from a subquery

2004-04-26 Thread Janko Richter
Perhaps this helps: CREATE AGGREGATE concat ( BASETYPE = text, SFUNC= textcat, -- is function of operator 'text || text' STYPE= text, INITCOND = '' ); SELECT P.personid, P.name, concat( N.note ) AS allnotesbythisperson FROM tblperson AS P INNER JOIN tblnotes AS N ON N.per