1

我有这个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. 我该怎么做呢?

4

1 回答 1

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
于 2013-03-18T15:01:55.443 回答