我有SQL
MSQL
语句可以准确选择我想要的内容(我正在寻找并尝试删除旧数据):
SELECT *
FROM `reviews` as r
JOIN items as i
ON i.item_id = r.item_id
JOIN master_cat as c
ON i.cat_id = c.cat_id
WHERE category is null
现在,我需要一种方法只从名为reviews
的表中删除这些行。我该怎么做呢?
答案 0 :(得分:2)
DELETE
语句将是,
DELETE r
FROM reviews r
INNER JOIN items i ON i.item_id = r.item_id
INNER JOIN master_cat c ON i.cat_id = c.cat_id
WHERE category is null