1.第一种方法
select * from tablename where time = (select max(time) from tablename)
2第二种方法
稍微麻烦点,不使用max()函数,对时间进行排序后选择第一个
select * from tablename where time = (select top 1 time from tablename order by time DESC)
2023-10-04 14:04:46
1.第一种方法
select * from tablename where time = (select max(time) from tablename)
2第二种方法
稍微麻烦点,不使用max()函数,对时间进行排序后选择第一个
select * from tablename where time = (select top 1 time from tablename order by time DESC)
下一篇:mysql 常用语法