Friday, January 25, 2013

Subquery needs to be aliased in T-SQL

This is not necessary in Oracle.

select decode(c1,'a','not null','null value')
from
(
select null c1 from dual
union
select 'a' from dual
)

In T-SQL, it should be aliased.

select c1
from
(
select null c1 from dual
union
select 'a' from dual
) a

No comments: