select a1,a2,decode(a3,'迟到','迟到'),decode(a3,'早退','早退') from table1

解决方案 »

  1.   

    研究研究可以实现你的功能
    http://searchdatabase.techtarget.com.cn/tips/303/2295803.shtml
      

  2.   

    存储过程实现
    create or replace procedure protable1 As
    va = varchar2(20) :='';
    vselect varchar2(200) :='';
    Cursor table_Cur IS 
           SELECT *  
           FROM table1 
    begin  
       For vtable IN table_Cur LOOP
         IF vtable.a3 != va Then
              IF vselect != '' Then
                  DBMS_OUTPUT.Put_line(vselect );
                  vselect :='';
               End IF;
               vselect := vselect || vtable.a1||','||vtable.v2||','||vtable.a3;
               va := vtable.a1;      Else
              vselect := vselect ||','||vtable.v3;
          End IF;            
       End Loop;
       DBMS_OUTPUT.Put_line(vselect );
    end protable1 ;