下图右侧关系节点号,左边是根据节点关系连接的节点图,我想直接sql查询出孤立的节点号(圈红的)
select * from 表 where 节点1 is nul and 节点1 not in(select 节点2 from 表)
union
select * from 表 where 节点2 is nul and 节点2 not in(select 节点1 from 表)
效率应该不怎么样,我感觉这样能查出来,也没试过,你试试看