My current query involves joining multiple tables and I'm using full outer join for it. However, my query resulted in multiple columns of the same name. How do I combine the result into one single column?
Below is an example of my query
Select table1.a,table1.b AS "chocolate",table2.b AS "chocolate"
full outer join table2 ON table1.c = table2.c
WHERE table1.a > 100
According to the attached screenshot, it seems as though only one of the two columns can have a value, and the other is always
null. If this is true, you could
coalesce the results into a single column:
SELECT table1.a, COALESCE(table1.b, table2.b) AS "chocolate" FROM table1 FULL OUTER JOIN table2 ON table1.c = table2.c WHERE table1.a > 100