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: How to find tuples with same attr. value

Re: How to find tuples with same attr. value

From: Jesse Baldwin <jbaldwi_at_talusinc.com>
Date: 1997/07/01
Message-ID: <1283323.ensmtp@talusinc.com>#1/1

hjelt_at_cc.helsinki.fi wrote:
>>
>> If i hava a table like:
>>
>> P ,T
>> -----
>> 1 1
>> 2 2
>> 3 2
>> 4 3
>> 5 4
>> 6 4
>> 7 4
>> 8 5
>> etc. (P is unique, T is not)
>>
>> how do i find those tuples where T-value appears 1, 2, 3 and 4 times?
>> Thank you
>> andy.

Try
SELECT P,T
FROM table
WHERE T IN (SELECT T

             FROM table
            GROUP BY T
            HAVING COUNT(*) > n)

/

(n being the number of repeating values you wish to select for)

Jesse Baldwin
Talus Inc.

--
Received on Tue Jul 01 1997 - 00:00:00 CDT

Original text of this message

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