开发者

Selecting the newest row in T-SQL

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜