Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

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

1042


What are pl sql data types?

1017


What is dense_rank in sql?

989


How can I see all tables in sql?

1078


Why we use stored procedure instead of query?

1000


how many values can the set function of mysql take? : Sql dba

993


Is record in oracle pl sql?

969


what is a table called, if it has neither cluster nor non-cluster index? What is it used for? : Sql dba

975


what is a scheduled jobs or what is a scheduled tasks? : Sql dba

965


What is difference between db2 and sql?

1006


What is coalesce in sql?

1064


Is clustered index a primary key?

950


What is offset in sql query?

1124


What is rtm in testing?

1121


how to shut down the server with 'mysqladmin'? : Sql dba

1014