Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
bheema
Starting Member
12 Posts |
Posted - 2011-11-16 : 01:07:12
|
| hi, this is bheema i want delete all duplicate rows at a time like thissno name sal1 bheema 50001 bheema 50001 bheema 50001 bheema 5000 in this i want delete 3 duplicate rows at a time.i need o/p like thiso/p: sno name sal 1 bheema 5000 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-16 : 01:14:52
|
| [code]delete tfrom (select row_number over (partition by sno,name,sal order by newid()) as rnfrom table)twhere rn >1[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
bheema
Starting Member
12 Posts |
Posted - 2011-11-16 : 01:59:39
|
| any simple query is thr for this? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-16 : 02:04:54
|
quote: Originally posted by bheema any simple query is thr for this?
what does that mean?why above is not simple?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
bheema
Starting Member
12 Posts |
Posted - 2011-11-16 : 02:09:02
|
| in this error is coming error is ora-00933 sqlcommand not properly ended |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-16 : 03:33:20
|
quote: Originally posted by bheema in this error is coming error is ora-00933 sqlcommand not properly ended
Ok so you're using oracle and in wrong forumthis is ms sql server forum so solutions given here are guaranteed to work only in sql server.Try this also and if its also not working please try your luck in oracle forums like www.orafaq.comdelete tfrom (select row_number over (partition by sno,name,sal order by sno) as rnfrom table)twhere rn >1 ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|