I have to create a query that verifies if a column is not null and join using it, but if it's null I must to join another column.
if was possible, must be something like that
SELECT A FROM DBTEST
IF ( NOT B = NULL)
INNER JOIN DBTEST2.B = DBTEST.B
ELSE
INNER JOIN DBTEST2.C = DBTEST.B
Any idea?