Re: How to do this query?

From: Don Vick <dvick_at_lanier.com>
Date: 1995/04/25
Message-ID: <D7Lo0D.JI4_at_lanier.com>#1/1


>In article <0098F132.BC764E1C_at_vms.csd.mu.edu>,
> <5603liul_at_vms.csd.mu.edu> wrote:
>> I wonder how I can do this query?
>>
>> Assume I have a table, say A. In A, there are two columes,
>>Say, B, C. Let's assmue it looks like this.
>> B C
>> --- ---
>> 1 2
>> 2 3
>> 3 3
>> 4 6
>>
>> How can we find the columns with duplicate C's? Here,
>>it is (2,3) and (3,3).

I think this will work:

	select b,c from a where c in
		(select c from a group by c having count(*) > 1)

Don



Donald E. Vick (dvick_at_lanier.com, dvick_at_crl.com) Voice: (404) 493-2194 Fax: (404) 493-2399 Received on Tue Apr 25 1995 - 00:00:00 CEST

Original text of this message