I am using postgresql 9.3. I have 2 tables like following:
create table table1 (col1 int, col2 int);
create table table2 (col2 int, col4 int);
insert into table1 values
(1,2),(3,4);
insert into table2 values
(10,11),(30,40),(50,60);
My expected resultset is as follow:
COL1 table1_COL2 table2_COL2 COL4
1 2 10 11
3 4 30 40
(null) (null) 50 60
I have tried to use with, join but not getting the expected result. I am not intending to join these two tables. Only I want the results should come in one resultset so that I don't need to query in database for 2 times.
relationshipbetween the tables.row_number()and thenFULL OUTER JOINon that. So you can. But you shouldn't.)