Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: query question
spedwards_at_x.qwest.net says...
> I have a table of 20,000 rows in which I'm trying query 3 specific columns.
> Column A is a number and there are only 10 distinct numbers in column A,
> Column B is varchar which has about 25 distinct variations, and column B
> is another number but has 500 distinct numbers.
>
> I'm trying to query these 3 columns and count the number of distinct
> combinations
> of columns B and C for each of 10 distinct numbers in column A. But, I have
> just
> wall with this one.
Dunno why. Just a distinct concatenation of the two columns.
select colA, count( distinct colB||colC)
from tablename
group by colA
Geoff M Received on Tue Apr 13 2004 - 00:35:34 CDT