I have query that LEFT joins information from two tables. With code with following joins
LEFT JOIN A on source = news_id
LEFT JOIN B on source = other_news_id
How can join or display data from the two columns so it produces one column information.
ID source Left Join on ID a Left Join on ID b
a 1 info1 <null>
a 2 info2 <null>
b 3 <null> info3
b 4 <null> info4
Something along the lines of
ID source info
a 1 info1
a 2 info2
b 3 info3
b 4 info4
How can I bring all left joins into one column?
You can use
COALESCE()if there will always only be one value. It returns the first non-null argument.