kiran kumar

kiran kumar

  • NA
  • 8
  • 749

How can i group multiple rows with case statement

Mar 20 2018 1:23 PM
Hi Friends,
 
I i have table like below ; i need to group by CWID and RequestNo and based on Type (Email or PC) corresponding status should capture in two(Emailstatus and PC status) new columns. Kindly let me know the query if you know please.
 
 REQUESTNO CWID Type Status
 
 
 Request 1    ABC    Email    Completed 
 Request 1    ABC    PC WIP 
 Request  2    ABC    Email WIP 
 Request  2    XYZ    PC    Completed 
 Request     2 XYZ    Email Completed 
 
I need out put like this
 
 Request No CWID Email status PC status
 Request 1 ABCCompleted WIP
 Request 2 ABC WIP N/A
 Request 2 XYZ Completed Completed
 
 
Thanks in advance,
Kiran 
 

Answers (4)