Re: Query question
Posted in 1995
Pierluigi Frullani — — source: Informix-list mailing list archive (1991-1998)
>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 ....
Have you tried :
SELECT COUNT (DISTINCT field ) FROM SOME TABLE ...
[WHERE conditions1...]
Hope this help ...
P.S. Sorry for my not good english
Cheers
Pierluigi "PIGI" Frullani
Frumar srl
pigi@frumar.it