how can i select the last 90 rows from a table in sql ?
Asked
Active
Viewed 127 times
-2
-
5There is no such thing as "the last 90 rows" from a table. SQL tables represent *unordered* sets. – Gordon Linoff Sep 24 '17 at 14:21
-
be more specific, but am sure you want to sort in revers order depending on a column – Temani Afif Sep 24 '17 at 14:23
-
1Possible duplicate of https://stackoverflow.com/questions/4193705/sql-server-select-last-n-rows – Cale Sep 24 '17 at 14:24
-
Lack of details in your question but you can look for LIMIT and OFFSET SQL CLAUSE – Arrabidas92 Sep 24 '17 at 14:25
-
1Possible duplicate of [SQL Server SELECT LAST N Rows](https://stackoverflow.com/questions/4193705/sql-server-select-last-n-rows) – liam Sep 24 '17 at 14:25
1 Answers
0
SELECT * FROM Table1
WHERE
table_row_id > (SELECT MAX(table_row_id) - 90 FROM Table1);

Guru0008
- 54
- 1