Answer the question
In order to leave comments, you need to log in
How to remove duplicates in SQL tables?
There is a table with the following content:
cname | cmail
--------------------
Abyz | [email protected]
StroyMast | [email protected]
Clever Shop | [email protected]
Clever Shop 3 | [email protected]
Big Mart 1 | [email protected]
Big Mart 2 | [email protected] It is
necessary to remove duplicates in the cmail column.
Result
cname | cmail
--------------------
Abyz | [email protected]
StroyMast | [email protected]
Clever Shop | [email protected]
Big Mart 1 | [email protected]
Thank you.
Answer the question
In order to leave comments, you need to log in
make the table duplicate and transfer all unique values
INSERT INTO TestTable (cname, cmail)
SELECT cname, cmail
FROM Users
group by cmail
SELECT cname, cmail
INTO TestTable
FROM Users
group by cmail
The easiest option
1. In a loop, go through all the records in the table
2. When reading each record, do a search in the table, is there such a record yet?
3. If there is, then delete it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question