这是我到目前为止得到的,但它错误:MySQL
UPDATE item_template_epix
SET armor =
(SELECT armor
FROM item_template)
WHERE entry IN (SELECT entry FROM item_template WHERE armor > 1);
错误:
[Err] 1242 - Subquery returns more than 1 row
这是我到目前为止得到的,但它错误:MySQL
UPDATE item_template_epix
SET armor =
(SELECT armor
FROM item_template)
WHERE entry IN (SELECT entry FROM item_template WHERE armor > 1);
错误:
[Err] 1242 - Subquery returns more than 1 row
我认为你需要这样的东西:
UPDATE item_template_epix
JOIN item_template ON item_template_epix.entry = item_template.entry
SET item_template_epix.armor = item_template.armor
WHERE item_template.armor > 1
你可以试试这个。
UPDATE item_template_epix SET (armor) = (WITH OneValue AS
(SELECT entry FROM item_template Where armor > 1))
SELECT armor FROM OneValue);