I have 2 different transtions in the same table how can i join them into one line without subquerys and then joining them because i'm trying to combine multiple transtions cases if i create subquery for each transtions case and join them its causing performance issue. really appricate your help
CUREENT VIEW
ORDER ACTION DATE_TIME_CREATED
D8ZH4RJSB-689 PICK 8/1/2018 0:35
D8ZH4RJSB-689 SHIP 8/1/2018 12:03
Requiered Output
ORDER PICK_DATE_TIME_CREATED SHIP_DATE_TIME_CREATED
D8ZH4RJSB-689 8/1/2018 0:35 8/1/2018 12:03
This is my current code
SELECT "ORDER", --,"ACTION",ship_complete_time as date_time_created
CASE WHEN "ACTION" = 'SHIP'
THEN ship_complete_time
END AS SHIP_COM_TIME,
CASE WHEN "ACTION" = 'PICK'
THEN ship_complete_time
END AS pick_time
FROM TRANSATIONS
WHERE "ORDER" = 'D8ZH4RJSB-689'
current output
ORDER SHIP_COM_TIME PICK_TIME
D8ZH4RJSB-689 (null) 2018-08-01 00:35
D8ZH4RJSB-689 2018-08-01 12:03 (null)
TRANSACTIONScontains data for only one of 2 actions, for any specificORDERvalue? If so, which one would that be? How would you expect the result to look like then? Would it be an empty result (rows omitted), or just aNULLvalue in the appropriate column?