82511/how-to-delete-duplicates-on-a-mysql-table
I need to DELETE duplicated rows for specified sid on a MySQL table.
How can I do this with an SQL query?
DELETE (DUPLICATED TITLES) FROM table WHERE SID = "1"
Something like this, but I don't know how to do it.
Hello @kartik,
This removes duplicates in place, without making a new table
ALTER IGNORE TABLE `table_name` ADD UNIQUE (title, SID)
Note: only works well if index fits in memory
Hope it works!! Thank you!!
Hello @kartik, If empName is a VARCHAR(50) column: ALTER ...READ MORE
I'm attempting to code a search box ...READ MORE
Hii, You can try this: $query="SELECT * FROM CountryInfo ...READ MORE
Hello @kartik, No. That will drop the table only ...READ MORE
Hey @kartik, First you have to go to ...READ MORE
Named route is used to give specific ...READ MORE
Hello, This is simple you just need to ...READ MORE
Hey @kartik, Named routing is another amazing feature of ...READ MORE
Hello @kartik, Add a limit to the delete query delete from orders where ...READ MORE
Hello @kartik, To see the index for a ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.