If you need to return whole rows of data (and not just one column), and you need to create one SQL query, do the following:
Left table join table by default for single row table
select coalesce(a.col1, d.col1) as col1, coalesce(a.col2, d.col2) as col2, ... from ( -- your defaults record select default1 as col1, default2 as col2, ...) as d left join actual as a on ((1 = 1) )
source share