Hi,I want to get all records where SID = 2, and within those records find a single record that has the latest date in DateUpdated field. This is what I have come up with:SELECT S1.PID, S1.UID, S1.MID, S1.SID, S1.DateCreated, S1.DateUpdatedFROM (SELECT [Table1].PID, [Table1].UID, [Table1].MID, [Table1].SID, [Table1].DateCreated, [Table1].DateUpdated FROM [Table1] WHERE [Table1].SID = 2 ) as S1WHERE S1.DateUpdated = (SELECT max(S2.DateUpdated) FROM (SELECT [Table1].PID, [Table1].UID, [Table1].MID, [Table1].SID, [Table1].DateCreated, [Table1].DateUpdated FROM [Table1] WHERE [Table1].SID = 2 ) as S2 )
Is there a way to do the same in a more efficient manner, or is this as short as it gets?Thank you,Val