table1包含列CITY和COUNTRY。 table2有列CITY。
如何从table2中删除所有与table1共有CITY的记录,以及COUNTRY ='Russia'?
请记住,两个表都有大约100万行数据
答案 0 :(得分:1)
您可以使用multitable delete syntax:
DELETE table2
FROM table1
JOIN table2
ON table1.city = table2.city
WHERE table1.country = 'RUSSIA'
答案 1 :(得分:1)
DELETE table2
FROM table2 INNER JOIN table1
ON table2.CITY = table1.CITY
WHERE table1.COUNTRY = 'Russia'