Re: Very Simple SQL question ... hepl ? ...

From: Kevin Loney <kevin.loney_at_astramerck.com>
Date: 1997/09/17
Message-ID: <01bcc3a0$754d11a0$aa9e02a7_at_LONEYK.astramerck.com>#1/1


Hank Griffioen <hank_at_daac.gsfc.nasa.gov> wrote in article <34201C6E.CF4C987B_at_daac.gsfc.nasa.gov>...
> I have a table called names that has last_name and pid in
> the table. I am tryint to find a simple query that
> will all me to select all rows that have duplicated last names.
>
> something like ....
> select duplicate last_name pid from person.
>
> smith 1
> smith 3
> stevens 6
> stevens 7
>

select last_name, count(*) from person
group by last_name
having count(*) > 1;

Kevin. Received on Wed Sep 17 1997 - 00:00:00 CEST

Original text of this message