第1个回答 2011-10-12
用子查询+“case when” or “decode”~
select (select decode(t.类型,'早班','☆','中班','#','晚班','√',null) from table t where t.name= t1.name
and t.考勤时间=1) 1,
(select decode(t.类型,'早班','☆','中班','#','晚班','√',null) from table t where t.name= t1.name
and t.考勤时间=2) 2,
(select decode(t.类型,'早班','☆','中班','#','晚班','√',null) from table t where t.name= t1.name
and t.考勤时间=3) 3,
.......N
from (select distinct name table) t1;
注:
考勤时间需要自己转换成天数
t.类型 需要改成table对应的类型字段