left join - SQL merge tables with matching columns -
how can merge 2 tables same column names 1 table? this:
the 2nd table should fill in 1st table.
this close got
select * animals left join best on animals.species=best.species; http://sqlfiddle.com/#!5/d0a98/3
but seems concatenate 2nd table on there.
is left join correct way this?
you should list columns in select. readily see need coalesce():
select a.price, a.species, coalesce(b.name, a.name) name animals left join best b on a.species = b.species; 
Comments
Post a Comment