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 / sarath

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)-1

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain in brief how does db2 determine what lock-size to use?

959


what are bind concepts in db2 cobol?

1034


Mention the definition of cobol in varchar field.

1179


What does db2 blu stand for?

1101


What is commit in db2?

996


What is a storage group (stogroup)?

1189


How do we specify index to include or not during bind process.

2070


How can you classify the locks in db2?

1032


What is db2 optimizer?

1178


Can you tell me how can you find out the # of rows updated after an update statement?

1044


What is db2 purescale?

943


What is buffer pool in the db2 database?

1046


How many databases are there?

989


What is a db2 table?

954


How to access db2 tables in mainframe?

990