1


I get error (1054): Unknown column 'wp_jpnx_survey_code.supplier_id' in 'field list'
But that column does exist... Does anyone know why or how to fix this?

This is the code I used:

CREATE VIEW survey_codes_complete_overview AS SELECT *,
wp_jpnx_survey_code.supplier_id AS a_id,
wp_jpnx_survey_supplier_info.supplier_id AS b_id FROM
wp_jpnx_survey_code AS a LEFT JOIN wp_jpnx_survey_supplier_info AS b
ON a.supplier_id = b.supplier_id;
2

You are using aliases for those tables. So, specify the alias when selecting the column.

CREATE VIEW survey_codes_complete_overview AS 
SELECT *, 
a.supplier_id AS a_id, 
b.supplier_id AS b_id 
FROM wp_jpnx_survey_code AS a 
LEFT JOIN wp_jpnx_survey_supplier_info AS b 
ON a.supplier_id = b.supplier_id

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.