0

I want to join the underneath tables. In order to do that, please see the underneath code. However, it is not possible to read the code due to the following error, since it is not able to read the header of municipilacity.

SELECT
    financial_data.Municipality,    
    financial_data.Average_income_per_working_person,   
    financial_data.Average_income_per_working_population,   
    financial_data.percent_40_with_lowest_income,   
    financial_data.Average_income_per_household,
    fundadata_zip_converter_dropped_columns.postcode,
    fundadata_zip_converter_dropped_columns.place_name,
    fundadata_zip_converter_dropped_columns.county_name,
    fundadata_zip_converter_dropped_columns.state_name,
    fundadata.postcode,
    fundadata.postcode
FROM
    fundadata
INNER JOIN fundadata_zip_converter_dropped_columns
   ON fundadata_zip_converter_dropped_columns.postcode = fundadata.postcode
INNER JOIN financial_data
    ON fundadata_zip_converter_dropped_columns.place_name = financial_data.Municipality
ERROR:  column financial_data.municipality does not exist
LINE 18: ...dadata_zip_converter_dropped_columns.place_name = financial_...
                                                              ^
HINT:  Perhaps you meant to reference the column "financial_data.Municipality".
SQL state: 42703
Character: 723
Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
  • 1
    The error message gives you the hint. Use: `financial_data."Municipality"` –  Nov 24 '21 at 11:38
  • Another example why the use of quoted identifiers [is discouraged](https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don.27t_use_upper_case_table_or_column_names) –  Nov 24 '21 at 11:39

0 Answers0