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

+12

distinct command delete duplicate data?

sql

9/11/2016 5:44:42 AM

Saurav Saini

4 Answers

New Answer

+2

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

+1

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);

0

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

0

no borra nada