简单的行列转换



  

 

select
            t.name,
            t.careerworkname,
            t.sup_lev,
            sum(decode(t.exam_date,
            to_date('2014-08-12',
            'yyyy-MM-dd'),
            decode(t.isok,
            'Y',
            1,
            0),
            0)) ok1,
            sum(decode(t.exam_date,
            to_date('2014-08-13',
            'yyyy-MM-dd'),
            decode(t.isok,
            'Y',
            1,
            0),
            0)) ok2 
        from
            supervisor_info t 
        where
            t.isdel = 0 
            and t.isok is not null 
            and t.plan_uuid = 'e599d877-680e-49a9-8bf1-b4dac1fdf491' 
        group by
            t.name,
            t.careerworkname,
            t.sup_lev;

 http://www.2cto.com/database/201108/100792.html

你可能感兴趣的:(行列转换)