Quote:
|
Originally Posted by zhouhaiming
(select a.f1, b.f2, NULL, ...
from table1 a, table2 b, ...)
|
The only reason that you cannot just SELECT NULL is that NULL has no datatype and every column must have a datatype.
NULLIF(1,1) returns NULL of datatype INT (since 1 is an INT constant);
likely, NULLIF('','') returns NULL of datatype VARCHAR.
For a more generic way of having NULL of a certain datatype (like e.g. DATE) you will have to use CAST:
Code:
SELECT ..., Cast(NULL as DATE), ...
FROM table1 ...
(or replace "DATE" by any datatype you want).