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 isolation level provides maximum concurrency?
How to execute stored procedures?
How can we read records for specific member in CL? AND rpg?
Mention the way of highlighting as well as putting a cursor to use in a cobol program.
When reorg is used?
What are bind parameters in db2?
What kind of database is db2?
Are views updateable?
What is coalesce in db2?
What is plan in cobol db2?
Which isolation level provides highest data integrity?
If anyone has IBM Certification Dumps pls forward to me & also let me know what are the Certification Codes that are available in DB2
What are the full forms of spufi and dclgen and why are they used?
How is a typical db2 batch pgm executed?
What is the purpose of using commit?