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 / jansi rani

SELECT EMPNAME,SAL FROM EMP GROUP BY EMPNAME,SAL

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

You schedule a job to run every minute what will happen if the first job runs more than 1 min? Will the second instance of the job start?

584


In one interview...interviewer ask me question pleas tell me sql server architecture.. can any body tell me the sql server architecture with digram

1508


Explain about remote stored procedure?

589


explain different types of joins? : Sql server database administration

529


Hi, I Created 3 Tables Person(PersID[prkey],Name,Email,Password), Project(ProjName,ProjID[prkey],ProjLeader,ProjManager) & ProjectInvolvement(EntryDate,ProjID[frkey],PersID[frkey],ProjDuration). For this how can i INSERT,UPDATE & DELETE Through PROCEDURE? Please Post the Answer for me. Desai.

1425






What is the distinction amongst delete and truncate?

585


What are the approximate numeric data types?

531


What is the difference between seek predicate and predicate?

582


What is temporal table?

475


What are key, name and value columns of an attribute? : sql server analysis services, ssas

571


What are the default system databases in sql server 2000?

536


Why main is user defined function?

563


You want to use a perspective in an mdx query. How do you select the perspective?

157


what is a major difference between sql server 6.5 and 7.0 platform wise? : Sql server database administration

497


What is the sql profiler?

542