我有
Update2 `Table1` AS T1 Inner Join `Table2` As T2
On T2.`Name` = T1.Name
Set T1.`ParentID` = T2.`ID`
我想先检查一下,在长周末后让大脑冻结,帮助赞赏。
我基本上想先检查一下
Select FieldA, concat(FieldC,', ',FieldD) `Table1` AS T1 Inner Join `Table2` As T2
on T2.`Name` = T1.Name
Set T1.`ParentID` = T2.`ID`
确保我得到了正确的结果。
答案 0 :(得分:1)
等效的SELECT可以是:
SELECT T1.`ParentID` = T2.`ID`
FROM `Table1` AS T1 Inner Join `Table2` AS T2
ON T2.`Name` = T1.Name
pt-query-digest是一个将UPDATE转换为SELECT的工具示例,因此它可以运行EXPLAIN。