thomas2075
thomas2075

Reputation: 31

deleting duplicates in the mysql database

I recently created a database for myself and I have a problem looking for duplicates. My point is that a given number in the database does not appear 2 times and I would like to detect something like that with a command. for now I have something like this but unfortunately it does not work. I would like several tables to be searched because the numbers will be entered into each of them. i created database in mysql

DELETE a FROM `SomeoneA` AND 'SomeoneB' AS a INNER JOIN `SomeoneA` AND 'SomeoneB' AS b WHERE a.number < b.number AND a.id = b.id

Upvotes: 0

Views: 40

Answers (1)

Tim Biegeleisen
Tim Biegeleisen

Reputation: 522007

Your delete join syntax is slightly off:

DELETE a
FROM SomeoneA AS a
INNER JOIN SomeoneB AS b
    ON a.id = b.id
WHERE a.number < b.number;

Upvotes: 1

Related Questions