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

posted @ 2019-05-13 18:23  小农_码  阅读(1594)  评论(0编辑  收藏  举报