小编典典

SQL Server - 更新时的内部联接

all

我有以下不起作用的查询。我究竟做错了什么?这甚至可能吗?

UPDATE ProductReviews AS R 
   INNER JOIN products AS P 
       ON R.pid = P.id 
SET R.status = '0' 
WHERE R.id = '17190' 
  AND P.shopkeeper = '89137'

阅读 91

收藏
2022-03-22

共1个答案

小编典典

UPDATE R
SET R.status = ‘0’
FROM dbo.ProductReviews AS R
INNER JOIN dbo.products AS P
ON R.pid = P.id
WHERE R.id = ‘17190’
AND P.shopkeeper = ‘89137’;

2022-03-22