Forum OpenACS Q&A: Response to Query return 0 row
2: Response to Query return 0 row (response to 1)
Posted by Michael A. Cleverly on 11/06/00 05:01 PM
The above query is kind of redundant. Presumably user_id is constrained to be unique in the users table, so rather than counting and grouping by user_id (when your where clause constrains us to user_id = 3) you could do:
select count(*) from users where user_id=3and Postgres will return one row (the value being either 0 or 1). The row only "disappears" when you add the group by clause.