當前位置:首頁 » 編程語言 » sql查詢最新記錄

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
閮藉彲浠

熱點內容
有意思吧源碼 發布:2025-08-29 07:48:13 瀏覽:415
資料庫地址格式 發布:2025-08-29 07:37:06 瀏覽:298
優美密碼櫃的原始密碼是多少 發布:2025-08-29 07:30:52 瀏覽:51
30萬青黴素怎麼配置 發布:2025-08-29 07:27:52 瀏覽:624
伺服器為什麼設置人數上限 發布:2025-08-29 07:27:17 瀏覽:402
lr如何監控多台伺服器的資源 發布:2025-08-29 07:14:55 瀏覽:10
androidudp廣播 發布:2025-08-29 07:06:23 瀏覽:851
linux系統wine如何配置 發布:2025-08-29 06:59:50 瀏覽:325
root怎麼退出編譯 發布:2025-08-29 06:41:02 瀏覽:251
訪問文件夾記錄 發布:2025-08-29 06:31:10 瀏覽:118