|
楼主 |
发表于 2010-12-9 16:47:47
|
显示全部楼层
select DISTINCT case ocUp when 0 then ocName else (……) end as 公司, hmWorkNo as '工号', case hmGender when 1 then '男' else '女' end as '性别',ocName as '部门',OS.osName as '岗位',hmAge as '年龄', case CONVERT(varchar(10) ,hmInDate, 120 ) when '1900-01-01' then ' ' else CONVERT(varchar(10) ,hmInDate, 120 ) end as '入职时间', case CONVERT(varchar(10) ,hmWorkDate, 120 ) when '1900-01-01' then ' ' else CONVERT(varchar(10) ,hmWorkDate, 120 ) end as '参加工作时间',hmNativePlace as '籍贯',hmEduSchool as '毕业学校',hmEduSpecial as '专业', case CONVERT(varchar(10) ,hmeduEnddate, 120 ) when '1900-01-01' then ' ' else CONVERT(varchar(10) ,hmeduEnddate, 120 ) end as '毕业时间' from HumanMain H left join OrganConfig OC on H.ocID=OC.ocID LEFT OUTER JOIN (SELECT osgid,osgWage,osOrder, CASE osglevel WHEN 0 THEN a.osname ELSE a.osname+LTRIM(RTRIM(STR(b.osglevel))) END AS osName FROM OrganStation a LEFT outer join OrganStationGrade b ON a.osid=b.osid) OS ON H.osgid=OS.osgid where H.hmState=0
贴出部分SQL语句,蓝色标记的语句中,省略号的内容该如何写?或者用其他的什么语句? |
|