How to delete duplicate rows in the table

1 view
Skip to first unread message

malla kishore

unread,
Aug 28, 2007, 6:07:06 AM8/28/07
to mirac...@googlegroups.com
Hi Team,
 
Can any one suggest the way's to delete the duplicate rows in a table
 
example
i have
 
Table data
 
col1          col1
 

1            hai
2             how
1            hai
 
i want
 

col1          col1


1            hai
2             how

 

 
waiting for your replies
Thanks
kishore

Gokul Sagi

unread,
Aug 28, 2007, 6:59:30 AM8/28/07
to mirac...@googlegroups.com

Hi

This command is helpful for deleting the duplicate rows in the given example and it worked
succesfully.

db2 " delete from (select row_number() over (partition by col1 order by col2 desc ) as rn from data
data ) where rn >1 "

Thanks & Regards,

Gokul.Sagi
Miracle Software Systems pvt.ltd
Web:www.miraclesoft.com
contactno:+91-9290063929
email:gs...@miraclesoft.com


------- Original Message -------
From : malla kishore[mailto:mallak...@gmail.com]
Sent : 8/28/2007 6:07:06 AM
To : mirac...@googlegroups.com
Cc :
Subject : RE: How to delete duplicate rows in the table

malla kishore

unread,
Aug 28, 2007, 7:23:19 AM8/28/07
to mirac...@googlegroups.com
Hi Gokul,
 
Nice to have u r reply..
 
Can you please breif that with example
 
Advance Thanks 

 
--
కిశోర్ మల్ల
Reply all
Reply to author
Forward
0 new messages