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

1. what if null values retrived from database and no null indicator mentioned in query. What is sql code.

1 Answers   Cap Gemini,


what is SPUFI ?

2 Answers  


Can we update view in db2?

0 Answers  


Why cursor is used in db2?

0 Answers  


What is correlated subquery?

1 Answers  






What is concurrency in db2?

1 Answers  


Return code 100 means?

6 Answers   Cap Gemini,


i have one file having 100 of records? i want to display it like 20 records in one column and 20 records in another column total 40 records per page ? how ?

2 Answers   EDS,


What is an instance database?

0 Answers  


What is the difference between Primary key and unique index?

6 Answers  


How many types of page locks can be held in db2?

0 Answers  


WHAT IS MEANT BY COMMIT COMMAND?

7 Answers   Wipro,


Categories