Posts by Raul Baldner Junior • 13 points
1 post
-
1
votes1
answer663
viewsQ: LEFT JOIN with WHERE in the field of the first table OR field of the second table
SELECT COALESCE(tb2.numero_novo, tb1.numero_original) as numero FROM tb1 LEFT JOIN tb2 ON tb2.id = tb1.id WHERE tb1.numero_original = <PARAM> OR tb2.numero_novo = <PARAM> The above query…