Subselect, not too good. Use an aggregation instead:michael_hk said:Select username from Users where age = (Select min(age) from Users)
SELECT username, Min(age) AS YoungestMember
FROM Users
GROUP BY Users.age;
SELECT TOP 1 username, Age AS YoungestMember FROM Users
ORDER BY Age ASC
The subselect methodNerseus said:kejpas method works if you want all people, by age - not just the youngest. The subselect method works fine though you cant control which user you get back other than one - more or less randomly - from the users that match the youngest age. If 32 people are all 14 years old then youll get one of the 14, but you cant control which. The "TOP 1" with ORDER BY will let you have a little more control, if its needed.
-ner
will return all (32) users who are 14.michael_hk said:Select username from Users where age = (Select min(age) from Users)