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 / ashim kumar pal
SET rowcount 3
delete distinct * from table
set rowcount 0
select * from table
| Is This Answer Correct ? | 0 Yes | 4 No |
Post New Answer View All Answers
What is stored in the mssqlsystemresource database? : sql server database administration
what is denormalization? : Sql server database administration
Tell me what do we need queues in sql service broker?
How can we improve performance by using SQL Server profiler?
What is xml datatype?
How will you hide an attribute? : sql server analysis services, ssas
Explain different forms of normalization?
What command is used to rename the database?
Explain what is “asynchronous” communication in sql server service broker?
Explain difference between cross join and full outer join?
Mention a few common trace flags used with sql server?
Can you change the data type of a column in a table after the table has been created? If so, which command would you use?
Describe and explain about SQL native client?
Difference between Inner vs outer joins?
What are trace flags and mention a few common trace flags used with sql server?