“没有可行的替代postgresql”错误消息

时间:2017-07-06 13:23:23

标签: sql postgresql

  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上。

1 个答案:

答案 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'
                      )