On Oracle 9i, why does the following produce the result ‘abc’
select 'abc ' || (select txt from
(select 'xyz' as txt from dual where 1=2))
from dual
while this produces ‘abc xyz’:
select 'abc ' || (select txt from
(select count(*), 'xyz' as txt from dual where 1=2))
from dual
Why does adding count(*) to the subquery result in different behavior? Should the predicate where 1=2 preclude any results in the subquery?
returns 0. That is, a row with the value zero.