If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

You can also push the <select 1> into a common table expression if you worry that DB2 may not detect the identical query block and just evaluate it once (or if the query block has some non-deterministic predicates).