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
How to call shell script from pl sql procedure?
how to do backup entire database? : Transact sql
What is the source code of a program?
Is there a pl/sql pragma similar to deterministic, but for the scope of one single sql select?
What is using in sql?
what are the advantages and disadvantages of views in a database? : Sql dba
Is and as keyword in pl sql?
What is full form of rtm?
what are all the different normalizations? : Sql dba
What is difference between cursor and trigger?
What do you mean by field in sql?
How run sql*plus commands that are stored in a local file?
When are we going to use truncate and delete?
How do I pipe the output of one isql to another?
What is the difference between cross join and natural join?