I have this SQL query:
WHEN (TR.Test_Result LIKE '%PASS%' ) THEN 'Pass'
END) as 'ChamberResults',
MIN(TR.Date_Time) as 'ChamberDate'
dbo.Test_Results TR WITH (NOLOCK)
(TR.Date_Time BETWEEN '2013-12-23 00:32:35.757' AND '2013-12-23 23:32:35.757')
')<>'') AND LEN(TR.Serial_Number) > = 14
AND (System_ID LIKE '%Chamber%')
I want to modify the above query to pick only the first unique serial_number based on the Date_Time ascending and do CASE statement check on the first serial_number...
For e.g: C037197 2089 13 appears 3 times , but I need the first row to evaluate CASE statement..ignore the other 2 rows...
Input Data is attached..