我在使用IN
加入两个表时遇到问题。 例子:SQL加入运营商IN
with nodes(node_id, mpath) as (
SELECT node_id, drugs_cls_node_view.mpath
FROM drugs_cls_entries_view
inner join drugs_cls_node_view on drugs_cls_node_view.id = node_id
WHERE mnn_id in (13575)
)
select DISTINCT n.node_id, drugs_cls_node_view.*
from nodes n
inner join drugs_cls_node_view
on drugs_cls_node_view.id in (array_replace(string_to_array(n.mpath, '/'), '', '0')::bigint[])
我得到异常:
ERROR: operator does not exist: bigint = bigint[]
答案是肯定的,你可以使用IN连接两个表。 – jarlh
@jarlh但我得到了异常:'错误:操作符不存在:bigint = bigint []' – Wolkodav
请[将您的查询简化为重现问题所需的最小值](http://stackoverflow.com/help/mcve) 。这会让问题更加明确。 – IMSoP