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

what is utility for parm lib

2319


How to view db2 table structure?

970


What is null in db2?

958


What are bind parameters in db2?

989


What is db2 stogroup?

1104


What are the contents of a dclmgen?

1077


How to find the number of rows in a db2 table?

1077


What is a trigger in the db2 database?

1025


What is host variable in db2 cobol?

1036


What is bufferpool in db2?

995


What is the difference between spufi and qmf?

1065


What is the difference between db2 and oracle?

1072


Where can you declare a cursor in a cobol-db2 program?

1011


Describe major components of db2?

1050


What is the reason behind not using select * in embedded sql programs?

1059