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

Give a brief description of db2 isolation levels?

1013


What is explain plan in db2?

942


What is the usage of open cursor command?

1034


How do I add a column in db2?

997


What is rebind in db2?

999


What is a db2 schema?

1173


What is commit in db2?

996


What parameters are used to control the free space in DB2?

1009


What is the result of open cursor statement?

1028


Which components manage deadlocks in db2?

1016


What is the difference between spufi and qmf?

1053


Is db2 free?

1036


What are the uses of db2 optimizer?

1223


What are the various data types available in db2?

1012


Which command is used to remove all rows from a table?

1038