select * from rck where glyStatus in (1,2,3) and bfStatus=0 and delStatus=0 and status in (2,3)
select count(*) from rck where glyStatus in (1,2,3) and bfStatus=0 and delStatus=0 and status in (2,3) and rck_rcfl like '%市优秀拔尖人才%' --18
select count(*) from rck where glyStatus in (1,2,3) and bfStatus=0 and delStatus=0 and status in (2,3) and rck_rcfl like '%企业经营管理人才%' --8
--查询人才分类
select * from rck where glyStatus in (1,2,3) and bfStatus=0 and delStatus=0 and status in (2,3) and (rck_rcfl like '%市优秀拔尖人才%' or rck_rcfl like '%企业经营管理人才%' )
select * from rck where glyStatus in (1,2,3) and bfStatus=0 and delStatus=0 and status in (2,3) and (rck_rcfl like '%市优秀拔尖人才%' and rck_rcfl like '%企业经营管理人才%' )
--查询学位
select * from rck where glyStatus in (1,2,3) and bfStatus=0 and delStatus=0 and status in (2,3) and rck_qrzxl in('博士研究生','硕士研究生','中专','大学专科')
--人才分类和学历综合查询
select * from rck where glyStatus in (1,2,3) and bfStatus=0 and delStatus=0 and status in (2,3) and (rck_rcfl like '%晋中籍在外工作的高层次人才%' or rck_rcfl like '%企业经营管理人才%' ) and rck_qrzxl in('博士研究生','硕士研究生','中专','大学专科')
--按照年龄查询
select * from rck
where
glyStatus in (1,2,3) and bfStatus=0 and delStatus=0 and status in (2,3) and
(
(datediff(year,rcl_csrq2,getdate())-case when datediff(day,dateadd(year,datediff(year,rcl_csrq2,getdate()),rcl_csrq2),getdate()) >=0 then 0 else 1 end) <=20
or
(datediff(year,rcl_csrq2,getdate())-case when datediff(day,dateadd(year,datediff(year,rcl_csrq2,getdate()),rcl_csrq2),getdate()) >=0 then 0 else 1 end) between 36 and 40
or
(datediff(year,rcl_csrq2,getdate())-case when datediff(day,dateadd(year,datediff(year,rcl_csrq2,getdate()),rcl_csrq2),getdate()) >=0 then 0 else 1 end) between 55 and 60
or
(datediff(year,rcl_csrq2,getdate())-case when datediff(day,dateadd(year,datediff(year,rcl_csrq2,getdate()),rcl_csrq2),getdate()) >=0 then 0 else 1 end) >=61
)