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

Answers were Sorted based on User's Feedback



if there is a table with huge number of records and if i want to extract only first 3 records from..

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

if there is a table with huge number of records and if i want to extract only first 3 records from..

Answer / gummadi

select * from table_name
order by ascending
fetch first 3 rows only

Is This Answer Correct ?    3 Yes 0 No

if there is a table with huge number of records and if i want to extract only first 3 records from..

Answer / hemachandar

select * from table_name
fetch first 3 rows only;

Is This Answer Correct ?    2 Yes 0 No

if there is a table with huge number of records and if i want to extract only first 3 records from..

Answer / viji

If there is any specific order they have to be fetched then use fetch first 3 records only.
Without order by, fetch first 3 records only will retrieve any 3 records in random order.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More DB2 Interview Questions

how to resolve -805 . how to see dbrm and package not found

2 Answers   IBM,


What is a collection in db2?

0 Answers  


What do you mean by NOT NULL? When will you use it?

3 Answers  


what is difference between random and sequence file access

1 Answers   Syntel,


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

0 Answers  


How can you display the current date & current time ?

1 Answers   Cap Gemini,


Is it possible to update a primary key value? If not, what is the error code given? If yes, can more than 1 primary key column be updated at a time?

8 Answers  


Can we use select * statement in cobol program without giving field names ???

3 Answers   Zensar,


what is the role of the cursor in db2?

0 Answers  


What is buffer pool?

0 Answers  


What is a DBRM, PLAN ?

3 Answers  


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

0 Answers  


Categories