Re: SQL question
Posted in 1996
Rudy Fernandes — — source: Informix-list mailing list archive (1991-1998)
In article <54irr4$jir@cssun.mathcs.emory.edu>, elderbox@teleport.com wrote:
>On 17 Oct 1996, rickt wrote:
>
>> If I have the following SQL
>> select column1, count(*) from tablefoo
>> group by column1>>
>> It returns 24 rows with various counts.
>>
>> Is there a way to return just the number of rows that would have been
>> returned. (ie just the number 24)
>> I know I could put it in a temp table and then count that but, yuk
>>
SELECT COUNT (DISTINCT column1) FROM tablefoo
should do the trick. (But it will not give you your various counts!)
Cheers,
------------------------------------------
Rudy Fernandes
Gulf Insurance Co., KUWAIT
------------------------------------------