I have a table EMP in which the values will be like this
EmpId Ename Sal DeptId
11 Ram 10000 10
11 Ram 10000 10
22 Raj 20000 20
22 Raj 20000 20
33 Anil 15000 30
33 Anil 15000 30
I want to delete only duplicate Rows. After Delete I want
the output like this
EmpId Ename Sal DeptId
11 Ram 10000 10
22 Raj 20000 20
33 Anil 15000 30
Answer Posted / shankar
Delete FROM EMP where EMPID in (Select max(EMPID) from EMP
Group by EMPID having Count(EMPID)>1)
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Define Unique Key?
Difference between report and query parameter.
What is onf in normalization form?
Explain the use of containers in ssis?
What Are the Main Features of SQL Azure?
What is the difference between drop table and truncate table?
what exactly sql injuction.how to overcome.....
What is self contained sub query?
How do I partition a table in sql server?
What is the significance of null value and why should we avoid permitting null values?
What is difference between drop truncate and delete?
You accidentally delete the msdb database what effect does this have on your existing sql databases, and how do you recover?
What is the difference between lock, block and deadlock? : sql server database administration
How to store and query spatial data?
What are different types of views?