I have read solutions to merge two 3 row columns into one 6 row column but I think I want something else.
Let's say you have two columns:
Column 1 Column 2
NULL D
B NULL
C NULL
Is there a way to get one table that has all the information?
Column 3
D
B
C
I'm getting these columns after doing UNION ALL. So these are not the database tables but the columns that I have selected.
I'm using postgresql.
This is what I tried so far:
SELECT col1, col2, t2.col3 from t1
LEFT JOIN t2
ON t1.col1 like '%.'||t2.col3
UNION ALL
SELECT col1, col2, col3 From t1
LEFT JOIN t2
ON t1.col1 = concat(t2.col3, '.')
You can see that as I'm joining the same two tables on different conditions, I am getting different pieces of information.