Dear Sir,Here are the sample of idea on how to doing that:-CREATE TABLE EMPLOYEE( eName varchar(255), Department varchar(255), Shift varchar(50))INSERT INTO EMPLOYEE(eName,Department,Shift)values('John1 DoeA','IT','Shift1')INSERT INTO EMPLOYEE(eName,Department,Shift)values('John1 DoeB','IT','Shift2')INSERT INTO EMPLOYEE(eName,Department,Shift)values('John1 DoeC','IT','Shift3')select department,Shift1=max(Shift1),Shift2=max(Shift2),Shift3=max(Shift3) from(select department,Shift1= case when shift='Shift1' then eName else '' end ,Shift2= case when shift='Shift2' then eName else '' end ,Shift3= case when shift='Shift3' then eName else '' end from employee ) C group by department
Thank you.Regards,Michelle