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
Which component is responsible for db2 startup and shutdown?
Explain about dbrm.
What is meant by dclgen?
What is the maximum size of a char data type in db2?
What is image copy in db2?
Is ibm db2 open source?
What is the syntax for creating a table in the db2 database?
What is a page in db2?
How does cobol compile db2 program?
What is a db2 tablespace?
Are view updateable?
what are bind concepts in db2 cobol?
What is ibm db2 client?
For a db2 column that is being defined as decimal (11, 2), discuss the cobol picture clause.
What is the use of commit in db2?