222677 delete duplicates in database

We have duplicates in our database that need to be deleted. I was using this code to work on them one by one, but it is too time intensive:

UPDATE `listing_category` SET `listing_id` = '1036'

WHERE `listing_id` = 22119 ;

DELETE FROM `listing`

WHERE `listing_id` = 22119 ;

I need a new code to do this automatically. There are 2 tables that will be affected. I've attached the first table for reference and an example of the duplicate entries. You'll see that the listing_id is the only field that is different with duplicate businesses. Also you can see in the code above that the listing_category also needs to adopt the deleted listing id.

Kemahiran: Semua Boleh, MySQL

Lihat lagi: delete, delete duplicate, duplicate table, mysql delete, mysql delete using, delete mysql tables, mysql update field, mysql delete mysql database tables, mysql delete duplicate, mysql delete tables, code code database, deleted database mysql, delete update, delete table update, delete deleted mysql database, duplicate mysql, mysql deleted entries, delete duplicates, duplicate database mysql, adopt, duplicate mysql database, mysql duplicate entries, mysql database deleted, database code example, mysql duplicate

Tentang Majikan:
( 26 ulasan )

ID Projek: #1968912

Dianugerahkan kepada:


Details in PM.

$45 USD dalam 0 hari
(53 Ulasan)