select c_bpartner.name , c_bpartner.c_bpartner_id
from c_bpartner
where name in (select ad_org.name
from ad_org
where name='orgnamehere'
)
where isvendor='Y'
我收到错误no viable alternative at input "select"
。错误发生在子查询中的select
上。
答案 0 :(得分:1)
删除最后一个where isvendor='Y'
并使用AND isvendor='Y'
select c_b.name , c_b.c_bpartner_id
from c_bpartner c_b
where c_b.isvendor='Y' AND
c_b.name in (select a_o.name
from ad_org a_o
where a_o.name='orgnamehere'
)