sql查询最新记录
发布时间: 2024-05-24 19:14:52
㈠ sql 如何获取时间最新的记录
select top 1 * from table order by dateField desc 按时间倒序排,取第一条就是最新的记录
㈡ sql璇锋暀锛氭椂闂村簭鍒椾腑濡备綍镆ユ垒链鏂拌板綍
select eps,date,code from tb where date in(select max(date) from tb group by code) (yuanjirong镄勭瓟妗)
鎴栬:
select istinct code,(select date from tb where code=t.code order by date desc) as date,(select eps from tb where code=t.code order by date desc) as eps from tb as t
閮藉彲浠
热点内容