query to just fetch first matching row and stop execution.
once one matching row is found ..no more records should be checked.. if the first record is matching.. the query must stop

Answers were Sorted based on User's Feedback



query to just fetch first matching row and stop execution. once one matching row is found ..no more..

Answer / romeu viegas

Select ...
FROM ...
WHERE ...
FETCH FIRST 1 ROW ONLY

Is This Answer Correct ?    3 Yes 1 No

query to just fetch first matching row and stop execution. once one matching row is found ..no more..

Answer / parthasarathi

select * from
(select * from emp a where rowid<(select max(rowid) from
emp b where a.empno=b.empno) x
where rownum=1

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More DB2 Interview Questions

when we are trying to update db2 rows. if the program abends . how we will know that the last successful update row was

5 Answers   IBM,


Update command

1 Answers  


How to test SQL -911 error while developing COB-DB2 program

1 Answers   Satyam,


How connect db2 database to datastage?

0 Answers  


What happens to a cursor after a commit?

3 Answers  


What is the command used by TSO users to invoke DB2?

2 Answers   IBM,


What is the cascade rule and how does it relate to deletions made with a subselect?

1 Answers  


How do run the JCL which has 25 steps by skipping the following steps 5, 10,15 and 25 without using COND statement

5 Answers   Syntel,


What is ibm db2 connect?

0 Answers  


Why might full image copies be faster to implement than an incremental image copy?

4 Answers  


Why db2 is called db2?

0 Answers  


where can we use index and subscript ? with example ?

3 Answers   CTS,


Categories