查询是:
插入char_inventory(charid,location,slot,itemid,quantity)值(从chars中选择charid,其中charid不在(从char_inventory中选择charid,其中itemid = 65535),0,0,65535,10000);
答案 0 :(得分:0)
在INSERT INTO...SELECT
LEFT JOIN
语句
INSERT INTO char_inventory (charid, location, slot, itemid, quantity)
SELECT chars.charid, 0 , 0, 65535, 10000
FROM chars
LEFT JOIN char_inventory
ON chars.charid = char_inventory.charid AND
char_inventory.itemid = 65535
WHERE char_inventory.charid IS NULL
答案 1 :(得分:0)
这个怎么样
insert into char_inventory (charid,location,slot,itemid,quantity)
select charid,0,0,65535,10000 from chars where charid not in (select charid from char_inventory where itemid=65535)
答案 2 :(得分:0)
请改为尝试:
insert into char_inventory (charid,location,slot,itemid,quantity)
select charid,0,0,65535,10000
from chars
where charid not in (select charid from char_inventory where itemid=65535)