Re: Select count(*) problem
Posted in 2000
Carlos Benjamin — — source: Informix-list mailing list archive (1991-1998)
Art S. Kagel <kagel@bloomberg.net> wrote:
>First Informix does not permit you to GROUP BY a column that is NOT in the
>SELECTed list of columns so the query you reported should return an error
>actually!
Yep, that was my answer. Until I tried it. Got the same results in the same order in my count(*) column.
>Beyond that it is easily fixed by selecting column_b and adding
>a HAVING clause:
>
>SELECT column_b, count(*)
>FROM table_x
>WHERE> column_a = 12345
>GROUP BY column_b
>HAVING count(*) > 200
>ORDER BY column_b;
>
>Art S. Kagel
carlos
Currently on hiatus from unemployment.
----------------------
Do you do Linux? :)
Get your FREE @linuxstart.com email address at: http://www.linuxstart.com