Re: Query question
Posted in 1995
Nick Nobbe — — source: Informix-list mailing list archive (1991-1998)
On 13 Dec 1995, Francis Small wrote:
> Is there a way to return a count of the unique values in a field in a
> single statement? Right now I'm using a temporary table:
>
> SELECT UNIQUE field FROM table INTO TEMP temp_table
> SELECT COUNT(*) INTO row_count FROM temp_table
> DROP TABLE temp_table
stuff deleted >
Francis,
select count (unique field)
from table ;
Should do it. May take a while.
Yours,
Nick
*********************************
Nick Nobbe, Library of Congress
NLS/BPH
mail: nnob@loc.gov
*********************************