How to read the last row with SQL Server

后端 未结 17 827
别那么骄傲
别那么骄傲 2020-11-29 03:40

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.

17条回答
  •  隐瞒了意图╮
    2020-11-29 04:19

    I am pretty sure that it is:

    SELECT last(column_name) FROM table
    

    Becaause I use something similar:

    SELECT last(id) FROM Status
    

提交回复
热议问题