with a as(
select NSRSBH,NSRMC,ZGSWJ_DM,ZGSWSKFJ_DM,SSGLY_DM,FDDBRXM,ZCDZ dz,1 z
from hx_dj.dj_nsrxx nsr
where nsr.zcdz in (select n.zcdz from (select ns.zcdz,count(1) cnt from hx_dj.dj_nsrxx ns where ns.nsrzt_dm = '03'
and ns.kzztdjlx_dm <> '1130'
and ns.zcdz is not null and ns.ZGSWSKFJ_DM LIKE '13609%' group by ns.zcdz
having count(1) > 1) n)
union
select NSRSBH,NSRMC,ZGSWJ_DM,ZGSWSKFJ_DM,SSGLY_DM,FDDBRXM,SCJYDZ dz,2 z
from hx_dj.dj_nsrxx nsr
where nsr.scjydz in (select n.scjydz from (select ns.scjydz,count(1) cnt from hx_dj.dj_nsrxx ns where ns.nsrzt_dm = '03'
and ns.kzztdjlx_dm <> '1130'
and ns.zcdz is not null and ns.ZGSWSKFJ_DM LIKE '13609%' group by ns.scjydz
having count(1) > 1) n)
)

select * from a

order by z,dz

相关文章:

  • 2022-01-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2021-08-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-02-08
相关资源
相似解决方案