View previous topic :: View next topic
|
Author |
Message |
sailaja.sn
New User
Joined: 14 Jul 2008 Posts: 4 Location: Chennai
|
|
|
|
Hi,
My table contains some m duplicate rows . My requirement is to delete only n rows among those m duplicated rows.
To be more clear, please see the sample data:
TableA:
===============
ID Name Garde
==================
1 aaaa a1
1 aaaa a1
1 aaaa a1
2 bbbb b1
If we have used "delete from table where name = 'aaaa' " then it will delete all the rows with 'aaaa'.But my requirement is to keep a single row with 'aaaa' and delete all the other 2 'aaaa' rows that are duplicated.
Is there any way in resolving this issue.
Thanks & regards,
Sailaja |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
unload the table, process the qsam file, reload the table. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You might declare a cursor, fetch the "first" aaaa row and ignore it, fetch the others (if any) and delete them. |
|
Back to top |
|
|
|