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 -> how to ?? sql query

how to ?? sql query

From: Greg Hopkins <gregho_at_mosaix.com>
Date: 1997/01/15
Message-ID: <5bj0g5$jq3@dsinet.dgtl.com>#1/1

How can I code SQL to do this ??

The table looks like:

Table T
col C1 col C2


101           201
102           201
102           202
103           201
103           202
103           203

ie, in col C1 there is an ID number, and col C2 is a tag for the ID num.

I want to do something like:

SELECT C1 FROM T WHERE COUNT(C1) = 2 which would return 102 because ID 102 appears twice in column C1.

SELECT C1 FROM T WHERE COUNT(C1) = 3 would return 103 etc.

I started looking at GROUP BY, HAVING etc

Thanks !!!

Please respond to: gregho_at_mosaix.com Received on Wed Jan 15 1997 - 00:00:00 CST

Original text of this message

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