I have a table having few data and the shift details for one month.
For the whole month the shift are going to be same so now I want to know on what date is a EMP is in which shift.
My source table structure is :
CREATE TABLE SHIFT_SUMMARY_NEW
CREATE SEQUENCE SHIFT_SUMMARY_NEW_SEQ MINVALUE 1 START WITH 1 INCREMENT BY 1 CACHE 20;
CREATE OR REPLACE TRIGGER "MGMT"."SHIFT_MASTER_NEW_BR_I"
before insert on "SHIFT_SUMMARY_NEW"
for each row
if :NEW."SRNO" is null then
select "SHIFT_SUMMARY_NEW_SEQ".nextval into :NEW."SRNO" from dual;
ALTER TRIGGER "MGMT"."SHIFT_MASTER_NEW_BR_I" ENABLE;
Now i have two records in my source table like as below:
YEAR MONTHS EMP SUN MON TUE WED THU FRI SAT
2011 MAR PINKURAY WEEK OFF WEEK OFF IST PST EST EST IST
Attached the file for the source and expected result set.