what's wrong with this query

From: "Thomas T(dot) Thai" <tom(at)minnesota(dot)com>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: what's wrong with this query
Date: 2001-02-11 07:48:06
Message-ID: Pine.NEB.4.21.0102110147120.2475-100000@ns01.minnesota.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

what's wrong with that query?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alex Pilosov 2001-02-11 08:27:33 Re: what's wrong with this query
Previous Message Tom Lane 2001-02-11 02:52:19 Re: Strange bug in PLpgsql?