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

if there is a table with huge number of records and if i
want to extract only first 3 records from the table, what
query i have to provide to retreive first 3 records

Answer Posted / andank

SELECT * FROM <qualifier>.<table_name>
FETCH FIRST 3 ROWS ONLY
WITH UR;

The above query holds good, if you are thinking to fetch
rows in any specific order. Otherwise make use of "ORDER
BY".

If you want to filter the records bases on some condition
and fetch first 3 rows, make use of WHERE clause. For
example, if you want to see first 3 records of ACCOUNTS
department, use WHERE DEPTID ='Accounts' FETCH FIRST 3 ROWS
ONLY

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which isolation level provides maximum concurrency?

1093


How to execute stored procedures?

1068


How can we read records for specific member in CL? AND rpg?

648


Mention the way of highlighting as well as putting a cursor to use in a cobol program.

1020


When reorg is used?

1072


What are bind parameters in db2?

983


What kind of database is db2?

977


Are views updateable?

1070


What is coalesce in db2?

1058


What is plan in cobol db2?

1061


Which isolation level provides highest data integrity?

1043


If anyone has IBM Certification Dumps pls forward to me & also let me know what are the Certification Codes that are available in DB2

1976


What are the full forms of spufi and dclgen and why are they used?

1025


How is a typical db2 batch pgm executed?

1110


What is the purpose of using commit?

1042