首页 > 数据库技术 > 详细

sql

时间:2015-12-14 01:17:39      阅读:230      评论:0      收藏:0      [点我收藏+]
 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‘)

 

sql

原文:http://www.cnblogs.com/zzzzw/p/5043866.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!