Mensaje citado por Marco Lazzeri <marcomail@noze.it>:
> I've got a table called 'main' described as follow
>
> CREATE TABLE main (
> id_other_table INT,
> value CHAR
> );
>
> and a table called 'other' described as follow
>
> CREATE TABLE other (
> id INT PRIMARY KEY,
> value CHAR
> );
>
> I want to write a query on table 'main' that if 'id_other_table' is null
> returns value from itself, from table 'other' otherwise.
SELECT CASE WHEN id_other_table IS NULL THEN id_other_table
ELSE id
FROM main,other
> Thank you very much, have a wonderful day!
Same for you.
--
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
-------------------------------------------------------
Martín Marqués | Programador, DBA
Centro de Telemática | Administrador
Universidad Nacional
del Litoral
-------------------------------------------------------