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 the purpose of indexing?
What is a non equi join?
How to use group functions in the select clause in ms sql server?
What is constraints and its types?
What is policy based management (pbm)? : sql server database administration
Do you know what is rank function?
What are the database roles? : sql server security
How to test values returned by a subquery with the in operator?
Can you explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?
What is instead of dml trigger?
How we can refresh the view?
If you're given a raw data table, how would perform etl (extract, transform, load) with sql to obtain the data in a desired format?
What are sql server functions?
Does server sql treat char as a variable-length or fixed-length column?
How many types of keys are there?