adspace


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 sql or structured query language?

1228


What is sql server query analyzer?

1131


What are the different types of subquery?

1235


what is spatial nonclustered index

1060


List the ways in which dynamic sql can be executed?

1087


How can you append an identity column to a temporary table?

1071


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?

1048


You have a stored procedure, which execute a lengthy batch job. This stored procedure is called from a trigger you do not want to slow the data entry process you do not want trigger to wait for this batch job to finish before it completes itself what you can do to speed up the process?

1215


What are different types of constraints?

1003


How to provide default values to function parameters?

1261


What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?

1200


Can we shrink data file in sql server?

1130


How to enter binary string literals in ms sql server?

1246


Can sql servers link to other servers like oracle?

919


explain different types of backups avaialabe in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration

1134