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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: How do I check for partial duplicates?

Re: How do I check for partial duplicates?

From: Chris Rezek <crezek_at_dotclick.com>
Date: Wed, 15 Aug 2001 15:18:42 -0700
Message-ID: <F001.0036C451.20010815153253@fatcity.com>

I did

DELETE FROM MEM_INFO A
  WHERE ROWID NOT IN (SELECT MAX(ROWID)

                      FROM MEM_INFO B
                      WHERE A.MEM_ID = B.MEM_ID
                      AND   A.MEM_NAME = B.MEM_NAME);

And that worked great. I could have replaced with MEM_TIME but since I know the records have been entered sequentially I went with ROWID which was faster.

Thanks guys!

Chris Rezek
Oracle DBA
Digital Music Network
http://www.dmn.com

"Seley, Linda" wrote:
>
> This will delete all single rows (where select mem_id,mem_name,count(*) from
> mem_info group by mem_id,mem_name having count(*) = 1). How about
>
> delete from mem_info mi1 where mem_time < (select max(mem_time) from
> mem_info mi2 where mi1.mem_id = mi2.mem_id and mi1.mem_name = mi2.mem_name);
>
> Linda
>
> -----Original Message-----
> Sent: Wednesday, August 15, 2001 4:27 PM
> To: Multiple recipients of list ORACLE-L
>
> All disclaimers attached to a delete command sent out ............
>
> Try this
>
> delete from mem_info
> where (mem_id, mem_name, mem_time) in (select mem_id, mem_name,
> min(mem_time) from mem_info group by mem_id, mem_name)
>
> -----Original Message-----
> Sent: Wednesday, August 15, 2001 5:08 PM
> To: Multiple recipients of list ORACLE-L
>
> Thanks!
>
> Now I need to delete the records that have the earlier MEM_TIME. How
> would I do that?
>
> Chris
>
> Kevin Lange wrote:
> >
> > select mem_id, mem_name from mem_info group by mem_id, mem_name having
> > count(*) > 1
> >
> > -----Original Message-----
> > Sent: Wednesday, August 15, 2001 3:48 PM
> > To: Multiple recipients of list ORACLE-L
> >
> > We have a table that may have partial duplicate rows. What select
> > statement do I write to return the partial duplicates?
> >
> > table_name = MEM_INFO
> >
> > MEM_ID
> > MEM_NAME
> > MEM_TIME
> > MEM_LAST
> >
> > I am concerned about two rows having the same MEM_ID and MEM_NAME.
> > Having the same MEM_TIME and MEM_LAST is okay.
> >
> > Thanks,
> >
> > Chris
> > --
> > Please see the official ORACLE-L FAQ: http://www.orafaq.com
> > --
> > Author: Chris Rezek
> > INET: crezek_at_dotclick.com
> >
> > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> > San Diego, California -- Public Internet access / Mailing Lists
> > --------------------------------------------------------------------
> > To REMOVE yourself from this mailing list, send an E-Mail message
> > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> > the message BODY, include a line containing: UNSUB ORACLE-L
> > (or the name of mailing list you want to be removed from). You may
> > also send the HELP command for other information (like subscribing).
> > --
> > Please see the official ORACLE-L FAQ: http://www.orafaq.com
> > --
> > Author: Kevin Lange
> > INET: kgel_at_ppoone.com
> >
> > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> > San Diego, California -- Public Internet access / Mailing Lists
> > --------------------------------------------------------------------
> > To REMOVE yourself from this mailing list, send an E-Mail message
> > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> > the message BODY, include a line containing: UNSUB ORACLE-L
> > (or the name of mailing list you want to be removed from). You may
> > also send the HELP command for other information (like subscribing).
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Chris Rezek
> INET: crezek_at_dotclick.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Kevin Lange
> INET: kgel_at_ppoone.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Seley, Linda
> INET: LSeley_at_IQNavigator.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Chris Rezek
  INET: crezek_at_dotclick.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Aug 15 2001 - 17:18:42 CDT

Original text of this message

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