Query question
Posted in 1995
Francis Chue — — source: Informix-list mailing list archive (1991-1998)
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
YES, it can be done. I have used the following syntax and it worked:
SELECT COUNT(UNIQUE field) FROM table
Francis Chue
American Tritech
email: fsc0@tritech.com