Is it possible to delete duplicate rows in a table without
using a temporary table ?

Answer Posted / krishnaraj p n

Can be done in a simple way.

DELETE FROM <TABLE NAME > WHERE <COLUMN NAME >IN
(
SELECT <COLUMN NAME> FROM <TABLE NAME >
GROUP BY <COLUMN NAME>
HAVING COUNT(<COLUMN NAME>) > 1
)

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If a user does not have permission to a table, but has permission to a view created on it, will he be able to view the data in table?

548


What is 'Join' and explain its various types.

617


What the class forname () does?

526


What are the pre-defined functions in the sql server?

511


Explain iaas, paas and saas?

72






What is temporal table?

468


Explain tablesample?

539


What is unpivot?

556


Explain user defined functions?

603


What is the order in which the sql query is executed?

510


Which data types generate inaccurate results if used with an = or <> comparison in a where clause of a sql statement?

526


Can you explain different types of locks in sql server?

512


How to use subqueries with the exists operators in ms sql server?

572


Can you explain what is the use of custom fields in report?

585


what are the different types of replication you can set up in sql server? : Sql server database administration

504