0

我正在尝试编写一个在更新语句中执行内部联接的查询。

这是我正在使用的当前查询:

UPDATE 
    singulation1.`q096_cq33r08-ds01-n-testtable`
SET 
    visual = t2.visual,
    inspection_status = t2.inspection_status,
    inspector_name = t2.inspector_name
FROM 
    singulation1.`q096_cq33r08-ds01-n-testtable` t1
INNER JOIN 
    singulation1.`q014_bq31t05-dw30-x` t2
ON 
    (t1.print = t2.print AND t1.id3 = t2.id3);

MySql 的某些方面不喜欢 FROM 子句。

4

1 回答 1

2

对于更新,您在更新子句中指定连接

UPDATE
    singulation1.`q096_cq33r08-ds01-n-testtable` AS t1
    INNER JOIN singulation1.`q014_bq31t05-dw30-x` AS t2
      ON t1.print = t2.print AND t1.id3 = t2.id3
SET
    t1.visual = t2.visual
    t1.inspection_status = t2.inspection_status,
    t1.inspector_name = t2.inspector_name
于 2013-11-06T20:31:23.717 回答