此查询显示#1064错误。
DELETE FROM product_price AS pp
WHERE pp.PRODUCT_ID IN (
SELECT PRODUCT_ID
FROM (
SELECT P.PRODUCT_ID
FROM product p
WHERE p.PRODUCT_NAME='watch') t
)
答案 0 :(得分:0)
使用JOIN
而不是像这样的子查询;)
DELETE pp FROM product_price AS pp
INNER JOIN product p ON pp.PRODUCT_ID = p.PRODUCT_ID AND p.PRODUCT_NAME='watch'
答案 1 :(得分:0)
在那里't'做什么?试试没有它,像这样:
DELETE FROM product_price AS pp
WHERE pp.PRODUCT_ID IN (
SELECT PRODUCT_ID
FROM (
SELECT P.PRODUCT_ID
FROM product p
WHERE p.PRODUCT_NAME='watch')
)