How to query 2 different schema tables with different column name same information in postgresql

Viewed 49

When I query I do not get match list side by side and database reference fails, why?

I tried using one connection and two different schemas, first schema name table has same reference details with second table column, and I would like to compare side by side what equals exactly from rw.reference table 1, with table 2 qt.ref_number because they should match between both. I only get output data from top first query with rd.reference and second table does not list anything with, qt.ref_number, why postgresql does not cross database reference?

Query:

Select distinct
rd.reference, 
region1_scorecard

From local_dev.user.rawdata rd
Inner join customerid as id
on rd.site=id.site

union all

Select distinct
qt.ref_number, 
region2_decision

From local_dev.account.quote qt
Inner join rep_id id
on qt.application=id.application
Order by rd.reference 
0 Answers
Related