SELECT * FROM ( SELECT ComplainId, MIN(CreatedDate) MIN_DATE FROM MAIN_TABLE GROUP BY ComplainId ) T INNER JOIN MAIN_TABLE M ON T.ComplainId = M.ComplainId AND T.MIN_DATE = M.CreatedDate
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)