want to delete 42k duplicate rows from table 18 mill rows [message #639108] |
Wed, 01 July 2015 16:29 |
|
cplusplus1
Messages: 58 Registered: October 2012 Location: usa
|
Member |
|
|
I have a table with 18 million rows and has 5 column combination primary key. column rev_center varchar(15), this one has same rev_center, one with 5 length and 15 length with all spaces.
rev_center '73000' i have same like this with spaces '73000 '
i want to delete those duplicates. which are close to 42k out of 18 million rows.
declare @GLNAME table (K_ACCT_NUMBER INT, REV_CENTER VARCHAR(15), SERVICE_DATE DATE, POSTING_DATE DATE, PDM VARCHAR(50))
insert @GLNAME
select 4543,'73000', to_date('01/22/2012'),to_date('01/24/2012'),'432' union all
select 4543,'73000 ', to_date('01/22/2012'),to_date('01/24/2012'),'432' union all ---this is duplicate can be deleted
select 3476,'55000', to_date('04/14/2012'),to_date('04/16/2012'),'634' union all
select 3476,'55000 ', to_date('04/14/2012'),to_date('04/16/2012'),'634' union all ---this is duplicate can be deleted
select 7666,'23450', to_date('05/18/2012'),to_date('05/18/2012'),'234'
select * from @GLNAME;
Thank you very much for the helpful info.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: want to delete 42k duplicate rows from table 18 mill rows [message #639313 is a reply to message #639166] |
Mon, 06 July 2015 02:32 |
pablolee
Messages: 2882 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
cplusplus1 wrote on Thu, 02 July 2015 15:14i used the query and it worked fine, lol what a shame...seniors
I'm not quite sure why you're taking the pissy attitude with me, I asked a perfectly reasonable question.
Just for clarity, are you saying that you ran that code in an Oracle database, and it executed correctly?
|
|
|