Re: what's wrong with this query

Поиск
Список
Период
Сортировка
От Alex Pilosov
Тема Re: what's wrong with this query
Дата
Msg-id Pine.BSO.4.10.10102110326200.10437-100000@spider.pilosoft.com
обсуждение исходный текст
Ответ на what's wrong with this query  ("Thomas T. Thai" <tom@minnesota.com>)
Список pgsql-general
On Sun, 11 Feb 2001, Thomas T. Thai wrote:

> still trying to port this app from mysql to pgsql, but getting this error:
>
> Database error: Invalid SQL: select
> t_stories.heading,t_stories.rid,count(*) as cmts from t_stories,t_comments
> where t_comments.toprid = t_stories.rid and t_stories.verified = 'y' group
> by t_comments.toprid order by t_stories.hits desc limit 5
> PostgreSQL Error: 1 (ERROR: Attribute t_stories.heading must be GROUPed or
> used in an aggregate function )
> Session halted.
Precisely this:
---
PostgreSQL Error: 1 (ERROR: Attribute t_stories.heading must be GROUPed
or used in an aggregate function )
---
add t_stories.heading to group by list, and it should work. Mysql
apparently allows such sloppy sql, but postgres won't.



В списке pgsql-general по дате отправления:

Предыдущее
От: "Thomas T. Thai"
Дата:
Сообщение: what's wrong with this query
Следующее
От: "Arun Malhotra - Roll No.99007"
Дата:
Сообщение: Re: selecting a random record