Subject | RE: [firebird-support] max count question |
---|---|
Author | Svein Erling Tysvær |
Post date | 2011-06-03T07:53Z |
>Hi Norman.If you only want one row returned, this can be slightly simplified (or at least, I think it is simpler):
>
>that's exactly what I'm looking for:
>
>with whatever as
>(select field_name,count(*) as kount
>from table_name
>group by field_name)
>select field_name from whatever
>where kount = (select min(kount) from whatever);
with whatever as
(select field_name, count(*) as kount
from table_name
group by field_name)
select field_name from whatever
order by kount
rows 1
HTH,
Set