开发者

Selecting the newest row in T-SQL

开发者 https://www.devze.com 2023-02-23 23:27 出处:网络
I have a database ta开发者_运维技巧ble containing a column called timestamp, which stores the system time for each of the rows inserted.

I have a database ta开发者_运维技巧ble containing a column called timestamp, which stores the system time for each of the rows inserted.

How do I select the row with the latest timestamp, i.e. the row that was inserted last?


SELECT TOP 1 * FROM [tableName] ORDER BY timestamp DESC
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号