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
Explain the Ways to improve the performance of a sql azure database?
You are creating an application where users are asked their gender in the gender combo box you have three options: ‘male’ , ‘female’ and ‘i choose not to disclose’ these options are stored in the table as 1, 0 or null which datatype should you use?
Can you please explain the difference between primary keys and foreign keys?
How display code or Text of Stored Procedure using Sql query in Sql Server ?
How to specify the collation for a character data type in ms sql server?
How many categories of functions based their return modes?
What is multi-statement table-value user-defined function?
What is scrollable cursor?
What the different topologies in which replication can be configured?
What are the difference between “where” and “having” clause in sql server?
mention different types of relationships in the dbms?
What is an index in sql?
Do you know exporting and importing utility?
How to connect to SQL Azure Database by using sqlcmd?
How to use “drop” keyword in sql server and give an example?