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 |
|
x0x0
Starting Member
2 Posts |
Posted - 2011-02-25 : 18:55:54
|
| ii have tried this query to remove duplicate values.but getting error like 'incorrect syntax near keyword where"select *2 from3 (select d.*4 , count(*) over5 (partition by empno) cnt6 from dup_emp d7 )8 where cnt > 1;what is wrong with this one?how to find duplicate rows in a table on a field that is text? |
|
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
Posted - 2011-02-26 : 00:07:02
|
| Try this :select * from (select d.* , count(*) over (partition by empno) cnt from dup_emp d ) as subtab where cnt > 1; |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-02-26 : 09:12:24
|
| whenever you're creating derived table give it an alias------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|