SELECT first value from 3 tables that is not null Having 3 tables with name(varcahr) value(varchar) pairs how do I select the value for a given name from one of the table with respect to the following conditions


select value from tab_1 if it exists for name else select it from tab_2 if it exists in tab_2 else from tab_3
do it in one giant select if possible
There are couple ways of get what you want. From the top of my head I can think about version with UNION, FULL JOIN, and LEFT JOIN. The latter seems to me as most preferable from readability and performance point of view : 

SELECT NVL(t1.value,NVL(t2.value,t3.value)) as value
-- Or use coalesce instead of NVLs :
--SELECT COALESCE(t1.value,t2.value,t3.value) as value
FROM
(SELECT 'name_to_search' as name FROM DUAL)a
LEFT JOIN table1 t1 ON (t1.name= a.name)
LEFT JOIN table1 t2 ON (t2.name= a.name)
LEFT JOIN table1 t3 ON (t3.name= a.name)