如何使用 SQL Server 读取最后一行 [英] How to read the last row with SQL Server
本文介绍了如何使用 SQL Server 读取最后一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用 SQL Server 读取最后一行的最有效方法是什么?
What is the most efficient way to read the last row with SQL Server?
该表以唯一键为索引——底部"键值代表最后一行.
The table is indexed on a unique key -- the "bottom" key values represent the last row.
推荐答案
如果你使用的是 MS SQL,你可以试试:
If you're using MS SQL, you can try:
SELECT TOP 1 * FROM table_Name ORDER BY unique_column DESC
这篇关于如何使用 SQL Server 读取最后一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文