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

If the main program has only cobol statements and subprogram has the db2 statements what is the procedure for precompilation. for which program we need to do the precompilation

1 Answers   IBM,


Why do chiropractors use drop table?

0 Answers  


What is the SQL query to select, delete and get count of duplicate rows in DB2?

2 Answers  


what is a plan and how do you refer the plan in the program?

2 Answers   Xansa,


What are foreign keys?

1 Answers  






How do you insert a record with a nullable column?

2 Answers  


What are concurrency issues?

0 Answers  


What os does db2 run on?

0 Answers  


What if we try to insert the base table through updatable view , but failed to give a column value which is defined as NOT NULL.

1 Answers   Cap Gemini,


What is db2 bind process?

0 Answers  


What is a dbrm in db2?

0 Answers  


how to resolve -805 . how to see dbrm and package not found

2 Answers   IBM,


Categories