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
mention if it is possible to import data directly from t-sql commands without using sql server integration services? If yes, what are the commands? : Transact sql
What are pl sql data types?
What is dense_rank in sql?
How can I see all tables in sql?
Why we use stored procedure instead of query?
how many values can the set function of mysql take? : Sql dba
Is record in oracle pl sql?
what is a table called, if it has neither cluster nor non-cluster index? What is it used for? : Sql dba
what is a scheduled jobs or what is a scheduled tasks? : Sql dba
What is difference between db2 and sql?
What is coalesce in sql?
Is clustered index a primary key?
What is offset in sql query?
What is rtm in testing?
how to shut down the server with 'mysqladmin'? : Sql dba