Thursday, September 17, 2015

create view with converting columns to rows

create or replace view prs_yattendancevw2
as select
   emp_no,work_date,
   rtrim (xmlagg (xmlelement (e, to_char(START_TIME,'dd-mm-yyyy hh24:mi') ||

',')).extract ('//text()'), ',') START_TIME
   ,rtrim (xmlagg (xmlelement (e, to_char(END_TIME,'dd-mm-yyyy hh24:mi') ||

',')).extract ('//text()'), ',') END_TIME
from
   come_leav
   where start_time is not null and end_time is not null
group by
   emp_no,work_date
/



Yasser

No comments:

Post a Comment