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 do you write an index?
what does the t-sql command ident_incr does? : Transact sql
What are functions in sql?
What do you mean by “trigger” in sql?
What is an exception in PL/SQL? What are the two types of exceptions?
What is crud diagram?
What are % type and % rowtype?
What is a recursive join sql?
What is error ora-12154: tns:could not resolve the connect identifier specified?
Can triggers stop a dml statement from executing on a table?
What is the purpose of primary key?
Can you inner join the same table?
how can we submit a form without a submit button? : Sql dba
What is difference between stored procedures and application procedures?
how to return query output in html format? : Sql dba