distinct command delete duplicate data? | SoloLearn: Learn to code for FREE!


distinct command delete duplicate data?


9/11/2016 5:44:42 AM

Saurav Saini

4 Answers

New Answer


no.. distinct will not delete data.. it will just displays the results without duplicate values


no..distinct is used with select statement If you are using SQL Server, you could use DELETE TOP 1. Ex: Suppose you have a table that Does Not have a primary key: id name --------------- 1 Tiger 2 Cat 1 Tiger 4 Monkey 2 Cat ----------------- DELETE TOP 1 FROM table1 WHERE id IN (SELECT id FROM table1 GROUP BY id HAVING COUNT (*)>1);


it doesn't delete..it just fetches unique records only by ignoring duplicate records!


no borra nada