If I have a table of products (> 10000 records), as the following example
[products]
+ ------------+---------------+
| product_no | name |
+ ------------+---------------+
| 84756289 | Screwdriver |
| 7365298 | Hammer |
| 49890986 | Nails, 3 inch |
.... etc etc etc .......
... finally the last row ...
| 846519846 | Staplers |
+-------------+---------------+
If I run a MySQL query like SELECT * FROM products LIMIT 10
(or SELECT TOP 10 * ...
in SQL Server) I will get the first 10 records from the table. But can I run a query that returns the 10 last records? Conceptually like this:
SELECT LAST 10 * FROM products
or
SELECT * FROM products LIMIT LAST 10
The table is not sorted. New products are simply added at the end... So I can't use ORDER BY
to solve my question