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

How do you write an index?

948


what does the t-sql command ident_incr does? : Transact sql

1054


What are functions in sql?

936


What do you mean by “trigger” in sql?

1054


What is an exception in PL/SQL? What are the two types of exceptions?

1275


What is crud diagram?

927


What are % type and % rowtype?

1020


What is a recursive join sql?

1050


What is error ora-12154: tns:could not resolve the connect identifier specified?

1053


Can triggers stop a dml statement from executing on a table?

1066


What is the purpose of primary key?

1002


Can you inner join the same table?

976


how can we submit a form without a submit button? : Sql dba

963


What is difference between stored procedures and application procedures?

994


how to return query output in html format? : Sql dba

1059