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
What are union and union all?
How do I change the column size in db2?
Explain in detail about buffer manager and its functionalities?
What is release/acquire in bind?
What are concurrency issues?
What is db2 purescale?
What is db2?
If I have a view which is a join of two or more tables, can this view be updateable?
What types of tables are there in the db2 database?
Which components manage deadlocks in db2?
What is the use of db2 optimizer?
What is the role of data manager in the db2 database?
How do I optimize a query in db2?
What is the difference between cursor and select statement?
What is package in cobol db2?