Delete duplicate rows from a table without primary key by
using a single query
Table Employee
empname salary
A 200
B 300
A 200
C 400
D 500
D 500

Output should be

A 200
B 300
C 400
D 500

Answer Posted / navneet sharma

select distinct * from tablename

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of the master database?

814


Why SQL Agent is used?

799


What are filegroups in sql server?

777


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?

721


What stored by the model? : sql server database administration

710






How do you rebuild an identity column?

716


What is the meaning of lock escalation and why/how to stop this? : sql server database administration

782


What are the disadvantages of indexes?

702


If we delete pack Spec what will be the status of pack Body ?

1169


Do you know what is blocking?

727


What is cube dimension? : sql server analysis services, ssas

713


Difference between drill down and drill through report.

726


What is awe?

739


Explain transaction server explicit transaction?

676


What is a full text index?

669