Re: How to do this query?

From: Evan Smith <nstn1726_at_fox.nstn.ca>
Date: 1995/04/25
Message-ID: <83666.nstn1726_at_fox.nstn.ca>#1/1


On 18 Apr 1995 21:34:27 GMT,
5603liul_at_vms.csd.mu.edu <5603liul_at_vms.csd.mu.edu> wrote:

>Dear netters:
>
> 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).
>
> Thanks.
>
>
> David
David:

I would do something like this:

select b c
  from a
 where 1 < (select count(*)

              from a
             where c = 3)

Hope this helps.
 --
 Evan Smith
 nstn1726_at_fox.nstn.ca Received on Tue Apr 25 1995 - 00:00:00 CEST

Original text of this message