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 to call shell script from pl sql procedure?

1359


how to do backup entire database? : Transact sql

1197


What is the source code of a program?

1120


Is there a pl/sql pragma similar to deterministic, but for the scope of one single sql select?

1065


What is using in sql?

1142


what are the advantages and disadvantages of views in a database? : Sql dba

1074


Is and as keyword in pl sql?

1014


What is full form of rtm?

1056


what are all the different normalizations? : Sql dba

1122


What is difference between cursor and trigger?

1129


What do you mean by field in sql?

1130


How run sql*plus commands that are stored in a local file?

1116


When are we going to use truncate and delete?

1024


How do I pipe the output of one isql to another?

1058


What is the difference between cross join and natural join?

1068