or exists验证联合查询关联表是否存在存在则查询出信息

select 1 as biaoshi from jdxtz where exists (

select * from gzpxx where gzpxx.bh=jdxtz.gzpbh and dqzt='借出'

or exists( select * from xlgl where xlgl.bh=jdxtz.gsxlbh and dqzt='借出')

or exists( select * from gtxx where gtxx.bh=jdxtz.gsgtbh and dqzt='借出')

) and rownum<=1

原文地址:https://www.cnblogs.com/java-llp/p/10858241.html