How to get the maximum field value in a table in MySQL?

If the "people" table contains the columns "name" (varchar) and "date of birth" (date), how to find the oldest / youngest friend?

0
source share
3 answers
SELECT * FROM buddies
WHERE birthdate = (
  SELECT MAX(birthdate) FROM buddies
)
LIMIT 1;
+1
source
SELECT name, birthdate FROM people ORDER BY birthdate ASC LIMIT 1

Please note that if there are two or more people with the same date of birth, only one is returned.

+4
source

If you want to include links

SELECT name 
FROM people
where birthdate = (select max(birthdate) FROM people)
+1
source

All Articles