sql
1 SELECT SUBSTR(HVO.CODE,4),HVP.PK_PSNDOC 2 FROM HRVM_VIRTUALPSN HVP, 3 HRVM_VIRTUALORG HVO, 4 HRVM_VIRTUALTYPE HVT 5 WHERE 1 = 1 6 AND HVP.PK_VIRTUALORG = HVO.PK_VIRTUALORG 7 AND HVO.PK_VIRTUALTYPE = HVT.PK_VIRTUALTYPE 8 AND HVT.TYPENAME = '碧业生' 9 AND HVP.PK_PSNDOC = '0001H210000000003OGK' 10 11 SELECT HVP.PK_PSNDOC 12 FROM HRVM_VIRTUALPSN HVP, 13 HRVM_VIRTUALORG HVO, 14 HRVM_VIRTUALTYPE HVT 15 WHERE 1 = 1 16 AND HVP.PK_VIRTUALORG = HVO.PK_VIRTUALORG 17 AND HVO.PK_VIRTUALTYPE = HVT.PK_VIRTUALTYPE 18 AND HVT.TYPENAME = '碧业生' 19 AND SUBSTR(HVO.CODE,4)='2016' 20 21 22 select HVO.CODE,substr(HVO.CODE,4),hvp.pk_psndoc 23 from hrvm_virtualpsn hvp, 24 hrvm_virtualorg hvo, 25 hrvm_virtualtype hvt 26 where 1=1 27 and hvp.pk_virtualorg=hvo.pk_virtualorg 28 and hvo.pk_virtualtype=hvt.pk_virtualtype 29 and hvt.typename='碧业生' 30 and hvp.pk_psndoc='0001H210000000003OGK' 31 32 33 34 35 select * from hrvm_virtualorg where name='2015届碧业生' and pk_virtualorg in (select pk_virtualorg from hrvm_virtualtype where TYPECODE='VO1') 36 37 select * from hrvm_virtualorg where pk_virtualorg in (select pk_virtualorg from hrvm_virtualtype where TYPECODE='VO1') 38 and substr(HVO.CODE,4)=2015 39 40 41 select substr(HVO.CODE,4),hvp.pk_psndoc 42 from hrvm_virtualpsn hvp, 43 hrvm_virtualorg hvo, 44 hrvm_virtualtype hvt 45 where 1=1 46 and hvp.pk_virtualorg=hvo.pk_virtualorg 47 and hvo.pk_virtualtype=hvt.pk_virtualtype 48 and hvt.typename='碧业生' 49 and hvp.pk_psndoc='0001H210000000003OGK' 50 51 52 select pk_psndoc from hrvm_virtualpsn hvp ,hrvm_virtualorg hvo where pk_virtualorg in (select pk_virtualorg from hrvm_virtualtype where TYPECODE='VO1') and substr(HVO.CODE,4)='2015'; 53 54 select * from hrvm_virtualorg where name='2015届碧业生' and pk_virtualorg in (select pk_virtualorg from hrvm_virtualtype where TYPECODE='VO1') 55 56 select pk_virtualorg from hrvm_virtualtype where TYPECODE='VO1' 57 58 select pk_psndoc from hrvm_virtualpsn where PK_VIRTUALTYPE in 59 (select PK_VIRTUALTYPE from hrvm_virtualtype where TYPECODE='VO1')
---- 动动手指关注我!或许下次你又能在我这里找到你需要的答案!ZZZZW与你一起学习,一起进步!