

If you check the output of the above query, the number of rows here is 35 rows. The above code gets all rows as the results. The rows of the stage table are 2 rows, and that of the main table is 34 rows.Ĭode: select A.REGION_ID,B.REGION_PROXY_CODE from ODS_CLICC_IPTV.REGIONS_LIVE AįULL OUTER JOIN ODS_CLICC_IPTV.REGIONS_LIVE_STG B
#Full join in postgresql full#
We now apply FULL outer join on the above two tables.

The above table shows the different columns in the specified main table – ODS_CLICC_IPTV.REGIONS_LIVE. The above table shows the different columns in the specified stage table – ODS_CLICC_IPTV.REGIONS_LIVE_STG.Ĭode: select * from ODS_CLICC_IPTV.REGIONS_LIVE The table has columns like REGION_ID, REGION_NAME, STATUS, etc.Ĭode: select * from ODS_CLICC_IPTV.REGIONS_LIVE_STG We have two tables, ODS_CLICC_IPTV.REGIONS_LIVE and ODS_CLICC_IPTV.REGIONS_LIVE_STG. The matching records are all records from the left table and all from the right table with null values for rows that do not match. The final result of the query will be all rows from both tables. Similarly, after the left table, all rows from the right table, B, will be taken, and corresponding rows from the left table, A, will take null values as they will not be matching. The corresponding rows from the right table, that is, B, will take null values as they will not be matching. Then it will take all records from the Left table, A. This signifies the intersection area of the Venn diagram. The left outer join condition is checked, and the rows that match this condition are chosen. When this query is fired, then first, all columns of tables A and B are selected. The area where both circles intersect is the one that signifies rows that are matching in both tables whenever the below statement is run, the compiler processes as below. With the help of the above Venn diagram, we can get an idea of how the full outer join works.
