Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: query question

Re: query question

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Mon, 12 Apr 2004 23:16:14 -0700
Message-ID: <1081836960.964632@yasure>


gmuldoon wrote:

> 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

With students ... we try to help them learn ... not give them the answers. That's why we ask to see their work.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Tue Apr 13 2004 - 01:16:14 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US