Your query won't quite work 100% of the time. Here are a couple of ways to get the desired results:DECLARE @Persons TABLE(id INT, last_name varchar(30), first_name varchar(30), age TINYINT)INSERT @Persons VALUES(1, 'Bryant', 'Kobe', 33),(2, 'James', 'Lebron', 23),(3, 'Bryant', 'Allen', 45),(4, 'Bryant', 'Phil', 88),(5, 'James', 'Malik', 44),(6, 'James', 'Test', 33) -- Added a row to show issue-- Original Query -- not quote rightselect * from @persons where age in ( select MIN(age) from @persons group by last_name )-- With RowNumberSELECT *FROM ( SELECT *, ROW_NUMBER() OVER (PARTITION BY last_name ORDER BY age ASC) AS RowNum FROM @Persons ) AS TWHERE RowNum = 1 -- With Join to derived tableselect P.* from @persons AS PINNER JOIN ( select last_name, MIN(age) AS age from @persons group by last_name ) AS T ON P.last_name = T.last_Name AND P.age = T.age