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
Write the command to remove all players named sachin from the players table.
What is right join sql?
Is sql harder than python?
How do I copy a table in sql?
What is the difference between inner join and left join?
What is a left join?
What is the sql query to display the current date?
How many scalar data types are supported in pl/sql?
How do I save a sql query?
what is the difference between clustered and non clustered index in sql? : Sql dba
What does fetching a cursor do?
Define overloaded procedure?
When should I use nosql database?
what are the join types in tsql? : Transact sql
What are different types of tables in sql?