pilsl@goldfisch.at writes:
> table1:
> uid | name
> ----+-----
> 1 | bob
> 2 | jim
> 3 | tom
>
> table2:
> uid | name
> ----+-----
> 2 | frank
>
>
> the final join should return:
> uid | name
> ----+-----
> 1 | bob
> 2 | frank
> 3 | tom
select uid, coalesce(table2.name, table1.name) as name from table1 left
join table2 using (uid);
--
Peter Eisentraut peter_e@gmx.net