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
Why do we need reorg in db2?
Mention the downsides of page level lock.
What is db2?
What does db2 stand for?
What is the function of logging in the db2 database?
What is a cursor in programming?
Where can you declare a cursor in a cobol-db2 program?
How many databases are there?
What are bind parameters in db2?
What is copy pending and check pending in db2?
Which command is used to remove all rows from a table?
Discuss about db2 bind?
what is diffrence b/w file-aid tool and file-aid utility???
How can we retrieve the total number of records in RPG & CLLE?
What is difference between rollback and commit?