I have a table called work_type and the data looks like:
Desc L_type Ch_ID Mod_Date
Std Process 11000 53901 2012-02-25 19:28:51.000
Not Req 16000 53901 2012-02-26 20:44:47.000
max sess 19000 53901 2012-02-25 19:44:05.000
max sess regist 19000 53901 2012-02-25 19:46:05.000
When L_type has multiple rows(for Ex 19000 in above data) then need most recent one based on Mod_Date
I want output like:
Te_pl In_pl Vn_pl Ch_ID
Not Req max sess regist Std process 53901
I wrote a query like this but it is not what i want:
Select Case when L_type = 11000 then Desc end as Vn_pl,
Case when L_type = 16000 then Desc end as Te_pl,
Case when L_type = 11000 then Desc end as In_pl,
Ch_ID
from dbo.Work_type