I have a table KIDS that have a Column AGE. I want to use an SQL query to get all the records of the oldest kids.
For example: If I have
Name Age
----------
David 10
Dan 10
Leah 8
Hannah 6
I want to get David's and Dan's records.
I have a table KIDS that have a Column AGE. I want to use an SQL query to get all the records of the oldest kids.
For example: If I have
Name Age
----------
David 10
Dan 10
Leah 8
Hannah 6
I want to get David's and Dan's records.
You can try below -
select * from tablename
where age in (select max(age) from tablename)
You can apply the below code:
select * from old_Records where age =(select max(age) from old_Records)