Re: Advanced SELECT
От | Richard Huxton |
---|---|
Тема | Re: Advanced SELECT |
Дата | |
Msg-id | 421D8EA6.7020107@archonet.com обсуждение исходный текст |
Ответ на | Advanced SELECT (Kai Hessing <kai.hessing@hobsons.de>) |
Ответы |
Re: Advanced SELECT
Re: Advanced SELECT |
Список | pgsql-sql |
Kai Hessing wrote: > > The normal clause would look like: > > SELECT c.companyname, s.sectorname FROM company c, sector s, > company_sector cs WHERE cs.cid = c.cid AND cs.sid = s.sid ORDER BY > c.companyname; > c.companyname | ??? (sectors) > ---------------+------------------------ > company1 | sectora, sectorb > company2 | sectora, sectorb, sectorc > company3 | sectora > company4 | sectorc > Search the mailing-list archives for "custom aggregate concat" and you'll quickly find an example of how to write your own custom aggregate (like SUM()). Warning - I don't think you can guarantee the order of elements in the aggregated sectors. -- Richard Huxton Archonet Ltd
В списке pgsql-sql по дате отправления: