简单的sql查询

来源:百度知道 编辑:UC知道 时间:2024/05/18 19:21:14
table1:
id age
1 20
2 30
3 25

求最简单的SQL,查出年龄最大的那条记录。

最简单的:
select top 1 * from table1 order by age DESC

楼主的:
select * from table1 where age = (select max(age) from table)

这样也行,不过不知道如果有相同的AGE会是什么样,楼主测试后告诉一声哦。

select * from table1 where age = (select max(age) from table)