How do you retrieve the last N records from a table?
Answer Posted / jyoti
We can retrieve last N records using Order by clause in the
query.
The ORDER BY clause using DESC
then give limits 0,N
for ex: SELECT * from table_name OREDER BY id DESC limit 0,10
It will return you last 10 records of the table.
| Is This Answer Correct ? | 1 Yes | 7 No |
Post New Answer View All Answers
What is the difference between syntax error and runtime error?
what are all types of user defined functions? : Sql dba
what is a join? : Sql dba
What is pls_integer in pl sql?
What is a subquery in sql?
give the syntax of grant and revoke commands? : Sql dba
How to run sql statements through the web interface?
What are the disadvantages of file system?
How long does it take to learn pl sql?
How to read xml file in oracle pl sql?
how tsql statements can be written and submitted to the database engine? : Transact sql
how do you tune the slow running queries in oracle db , explain the methodology
what is the difference between a web-garden and a web-farm? : Sql dba
What is a delimiter in sas?
What are triggers in sql?