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
閮藉彲浠
熱點內容