select 100 records from million records ?

Answers were Sorted based on User's Feedback



select 100 records from million records ?..

Answer / prachi

SELECT * FROM TABLENAME
FETCH FIRST 100 ROWS ONLY;

This will fetch 1st 100 records

Is This Answer Correct ?    20 Yes 0 No

select 100 records from million records ?..

Answer / ankit.:-)

if u want to fetch first 100 go for

select * from tablename fetch only 100 rows;

this will select only 100

Is This Answer Correct ?    5 Yes 5 No

Post New Answer

More DB2 Interview Questions

What happens to a tablespace when its recovery infromation has been removed and a full recovery is no longer possible?

2 Answers  


Can a primary key have null values? If we try to insert a null value in a primary key column, will it work or give an error code?

6 Answers  


what is the steps followed in EXPLAIN Process or EXPLAIN command. (Explain is for identifying the optimized access path but how or what is the steps for doing the EXPLAIN)

4 Answers   IBM,


What is the use of dclgen in db2?

0 Answers  


What is dpf in db2?

0 Answers  






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

4 Answers   UST,


wht displays the number of times a query modified ?

2 Answers   TCS,


How to check last update on table in db2?

0 Answers  


How do I add a column to an existing table in db2?

0 Answers  


I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.

0 Answers  


What is cursor with hold option in db2?

0 Answers  


I need to view the number of tables existing under one particular Owner. Is it possible? If so, pl give the SQL query for this?

2 Answers  


Categories