I am looking for a quick way to do
SELECT IFNULL(columna, columnb) FROM mytable
(I have dozens of columns and don't want to write a case for each of them)
I am looking for a quick way to do
SELECT IFNULL(columna, columnb) FROM mytable
(I have dozens of columns and don't want to write a case for each of them)
You can also use the standard COALESCE
keyword, which allows you to pass it multiple parameters:
SELECT COALESCE(columna, columnb, ..., columnz) FROM mytable
COALESCE keyword documentation
just found out:
SELECT nvl(columna, columnb) FROM mytable
http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions105.htm