Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> REPOST: Re: sql to find selective duplicate rows

REPOST: Re: sql to find selective duplicate rows

From: Brian Tkatch <SPAMBLOCK.Maxwell_Smart_at_ThePentagon.com.SPAMBLOCK>
Date: Thu, 24 Jan 2002 20:32:54 GMT
Message-ID: <1$--$%%%_$$$$%$$-$@news.noc.cabal.int>


On Thu, 24 Jan 2002 21:05:44 +0100, "lif" <t_at_i.gb> wrote:

>
>select first_name,mid_name,last_name,count(*)
>from nametab
>group by first_name,mid_name,last_name
>having count(*) =1
>
>??

I believe that mid_name should be after last_name to force GROUPing on first_name, last_name.

Of course, if he only wanted separate rows.

SELECT

	A.First_Name,
	A.Mid_Name,
	A.Last_Name
FROM
	NameTab A,
	NameTab B
WHERE
	A.First_Name = B.First_Name
  AND	A.Last_Name = B.Last_Name
  AND	A.MidName <> B.Mid_name;

Brian

This message was cancelled from within The Unacanceller's glorious new software, Lotus 1-2-3 For Rogue Cancellers. Received on Thu Jan 24 2002 - 14:32:54 CST

Original text of this message

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