This content has been marked as final. Show 4 replies
It is called pivoting. Please visit this link to find out how to do it ..
If you believe that my answer is correct, then please mark the answer as correct.
Thank you Fateh for the link!
Aggregate function made result incorrect
"Pivot" worked great .. but since the same ID may have multiple IN and OUT entries on same date .. using aggregate function will choose only a single value for IN and OUT.
My code looks like
WITH st_pivot AS ( SELECT ID , TO_CHAR(TIME,'dd-mm-yyyy') AS EDAY , action , time FROM timesheet_exercise ) SELECT * FROM st_pivot PIVOT ( MAX(TO_CHAR(TIME,'hh:mi PM')) FOR ACTION IN (1, 2 , 3) )
If want to display all IN and OUT entries for the same id for a specific date, how to do it ?
Any help please ?
Thank you so much for your time.