You can get SQL server to select the last N rows with the following query:
select * from tbl_name order by id desc limit N;
More Related Contents:
- Multiple INSERT statements vs. single INSERT with multiple VALUES
- Why is a UDF so much slower than a subquery?
- When using GETDATE() in many places, is it better to use a variable?
- I dont know sql syntax for my table [closed]
- CROSS JOIN vs INNER JOIN in SQL
- How to cast the DateTime to Time
- How can I schedule a job to run a SQL query daily?
- How to generate a range of numbers between two numbers?
- INNER JOIN vs LEFT JOIN performance in SQL Server
- Reset identity seed after deleting records in SQL Server
- How to avoid the “divide by zero” error in SQL?
- Generate Dates between date ranges
- Real life example, when to use OUTER / CROSS APPLY in SQL
- How to print VARCHAR(MAX) using Print Statement?
- Default row order in SELECT query – SQL Server 2008 vs SQL 2012
- Common Table Expression, why semicolon?
- T-SQL split string based on delimiter
- Counting DISTINCT over multiple columns
- SQL Server 2008: how do I grant privileges to a username?
- How do I find duplicates across multiple columns?
- Favourite performance tuning tricks [closed]
- sql varchar(max) vs varchar(fix)
- How to check which locks are held on a table
- How do I prevent a database trigger from recursing?
- TSQL – How to use GO inside of a BEGIN .. END block?
- SQL take just the numeric values from a varchar
- Backup a single table with its data from a database in sql server 2008
- COALESCE Function in TSQL
- Try_Convert for SQL Server 2008 R2
- When to use EXCEPT as opposed to NOT EXISTS in Transact SQL?