Re: Select count(*) problem
Posted in 2000
From: "darkemperor_uk" <johnsimpson46@johnsimpson46.fsnet.co.uk>
>
>I use informix online on HP-UX and am having problems with a select.
>The following query:
>select count(*)
>from table_x
>where>column_a=12345
>group by column_b
>returns 11 rows with the following output:
>(count(*))
>204
>172
>202
>203
>203
>202
>242
>202
>204
>201
>196
>What I want is a sub-query that returns a count of the rows where the count
>is greater than 200. So the final output here would be 9.
>I am not interested in an individual count of the rows grouped by column_b
>-
>just a final output of the number of column_b grouped rows > 200.
>Don't know if that makes sense.
select column_b, count(*)
from table_x
where column_a=12345
group by column_b
having count(*) > 200
into temp fred;
select count(*)
from fred;
???
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com