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 / viji

If there is any specific order they have to be fetched then use fetch first 3 records only.
Without order by, fetch first 3 records only will retrieve any 3 records in random order.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is the value function used?

613


can all users have the privilage to use the sql statement select * (dml)?

649


How is deadlock resolved?

656


What is a db2 tablespace?

611


Which components manage deadlocks in db2?

618






What is dbrm?

652


in my project..TEST is db2 8.1 version In PROD it is 7.1 if i do REORG in TEST.. can I use the same REORG jcl with out modification in PROD region (this is DB2 8.1 )? if not, what modification i need to do in my REORG control card?

1633


Which command is used to remove all rows from a table?

560


what is the sqlcode -501

11332


List down the types of triggers in the db2 database?

599


define clustering index.

626


What is runstats and reorg in db2?

808


When the like statement is used?

645


How many databases can be created inside an instance in db2 ?

609


How do I start db2 in windows?

579