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
How do I find the size of a sql server database?
How to rename an existing column with the "sp_rename" stored procedure in ms sql server?
Explain primary key, foreign key and unique key?
1. Tell me your daily activities 2. If sql server installation fails at time installation what will do 3. Where does the sql server installation log details are stored 4. After the installation what will you do for memory configuration 5. What is the difference between SQL max maximum memory and AWE memory 6. How will you configure AWE memory 7. How will setup an email alert for the backup job 8. After the SQL installation what are the jobs will you configure 9. What does –g mean in the sql startup parameter 10. What is the difference between Bulked log and Full recovery model 11. What is the difference between mirroring and log shipping 12. What are the steps to be followed before in-place up gradation 13. After installing the patch the sql server does not start and application team tells to rollback the changes .In this scenario what will you do
Retrieve the unique rows from table without using UNIQUE and DISTINCT keywords.
What is data block and how to define data block size?
How to create a simple user defined function in ms sql server?
What is the difference between TRUNCATE and DROP?
What is the difference between mysql and sql server?
How exceptions can be handled in sql server programming?
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 is the maximum row of a size?
How to convert character strings into numeric values?
How will you add a dimension to cube? : sql server analysis services, ssas
What are the disadvantages of indexes?