我收到以下错误:“单行子查询返回多行”,同时尝试执行以下查询:
select *
from wm_inventory
where item_id =(select item_cbo.item.id
from item_cbo
where item_name in ('564310','140270'));
答案 0 :(得分:2)
更改为:
select *
from wm_inventory
where item_id in (select item_cbo.item.id
from item_cbo
where item_name in ('564310','140270'));
您无法为" ="返回多行操作
答案 1 :(得分:1)
错误非常明显。使用in
:
select i.*
from wm_inventory i
where i.item_id in (select item_cbo.item.id
from item_cbo
where item_name in ('564310', '140270')
);