我尝试使用以下查询更新表中的列。在这种情况下,更新了 32000 行。
Update Table72D012 t2 set DEFINING_ARGUMENT_ID =
(
SELECT t3.ID
FROM Table70t3 t3,
Table70t1 t1,
Table70t0 t0,
Table4 t4
WHERE t2.Model_id = t4.ID
AND t3.ID = t1.PARAM_VALUE_BPVA_ID
AND t3.VALUE_BPAR_ID = t0.ID
AND t0.KEY='SPECIAL_KEY'
AND t1.LANGUAGE='en'
AND t4.Model = t1.name
);
我想要检查结果,我使用以下查询来获取相关 ID 的计数。我得到了结果 26500 .. 为什么结果(更新计数和选择结果计数)彼此不同?
如何更正 UPDATE 查询?
只选择
SELECT t3.ID
FROM Table70t3 t3,
Table70t1 t1,
Table70t0 t0,
Table72D012 t2,
Table4 t4
WHERE t2.Model_id = t4.ID
AND t3.ID = t1.PARAM_VALUE_BPVA_ID
AND t3.VALUE_BPAR_ID = t0.ID
AND t0.KEY='SPECIAL_KEY'
AND t1.LANGUAGE='en'
AND t4.Model = t1.name