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...

quary for
1> fetch last record
2> fetch in reverse order
3> fetch last 5 row
4> fetch second last record (their is no primary key)
i think concept of count can be use for this in 4th

Answer Posted / sudipta

u may try this
assuming table 'tab1' has 2 fields id & name
1) select id,name from tab1 order by id desc fetch first
row only
2) select id,name from tab1 order by id desc
3) select id,name from tab1 order by id desc fetch first 5
rows only
4) select id,count(*),name from tab1 order by id where count
(*)<(select count(*) from tab1)

u try these & if any problem u may write

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Mention the location where the output received from explain statement is stored.

1173


What does a deadlock mean in DB2?

1219


How can you count the number of rows from a table tab?

1137


What is the use of dclgen in db2?

1135


What is isolation level in db2?

1068


Before you give the explain statement, what are the prerogatives?

1081


Why select is not preferred in embedded sql programs?

1352


How can deadlocks be resolved?

992


What is the role of the data page in the db2 database?

1082


What is db2 purescale?

1052


How many databases are there?

1112


What is data manager?

1103


Who uses db2?

1112


What is db2 look?

1077


What do you mean by commit and rollback?

1089