Re: [BUGS] Bug with a join and group by query.
От | Bruce Momjian |
---|---|
Тема | Re: [BUGS] Bug with a join and group by query. |
Дата | |
Msg-id | 199902220242.VAA08570@candle.pha.pa.us обсуждение исходный текст |
Ответ на | Bug with a join and group by query. (Michael Richards <miker@scifair.acadiau.ca>) |
Список | pgsql-bugs |
> Hi. > I think I found a bug. My query works in mysql. > I have 2 tables. It's for a classifieds database. 1 is the categories, and > the second is the postings. Postings are categorised and related to a > category. I'll dump the contents of the tables and append it to the > message if anyone wants test data. > > postgres 6.4 does: > select cl_categories.catid,cl_categories.description,count(*) from > cl_categories,cl_postings where catid=categoryid group by catid; > ERROR: parser: illegal use of aggregates or non-group column in target > list You must group by all non-aggregate fields. That includes description. -- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
В списке pgsql-bugs по дате отправления: