Created
October 17, 2016 09:29
-
-
Save midnite81/ea867d9d91f81827088abeffc30d4552 to your computer and use it in GitHub Desktop.
Remove Duplicate Rows, Keeping the first lin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM my_table | |
USING my_table, my_table mt1 | |
WHERE my_table.id > mt1.id | |
AND my_table.my_column = mt1.my_column -- the column which you're checking for duplicates on | |
AND my_table.`type` = 'greeting'; -- any other conditions that you need to filter by |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment