How to retrieve duplicate rows in a table?
How to delete the duplicate entries in a table?
Answer Posted / lince thomas
it is very simple,,below
------------------------
select * from(
select row_number() over(partition by empname order by
empname)as rno,empname,salary from Emp1Pay)T
where T.rno>1
delete from Emp1Pay where empid=
(select empid from(select row_number() over(partition by
empname order by empname)as rno,empid
from Emp1Pay )T where T.rno>1)
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are actions, how many types of actions are there, explain with example? : sql server analysis services, ssas
What is user-defined multi-statement table-valued function?
How to use user defined functions in expressions?
how do you determine the Load performance of any query in sql server {example how do u determine performance of a select stmnt which returns Dynamically many no of records ... some times 100,1000,10000 etc., }
Which language is supported by sql server?
Can a stored procedure call itself or recursive stored procedure? How many levels sp nesting is possible?
What is trigger in salesforce?
Explain the disadvantages of cursors?
what is denormalization and when would you go for it? : Sql server database administration
What are the basic functions for master, msdb, model, tempdb and resource databases?
Explain about sql server login?
What is the difference between stored procedure and user defined functions?
How secure is sql server database?
Suppose you want to implement the one-to-one relationships while designing tables. How would you do it?
How to download and install the scaled-down database adventureworkslt?