I’m getting an error while attempting to populate my table with the following query:
INSERT INTO d_table
SELECT category.name, film_category.film_id
FROM category
INNER JOIN film_category.film_id ON film_category.category_id = category.category_id
It returns an error
"relation film_category.film_id does not exist"
These are the tables in the database:
**category**
category_id
name
**film_category**
film_id
category_id
Need both fields in table.
2
Answers
Your INNER JOIN doesn’t appear to be correct. You aren’t specifying a relation, but a column. I think you wanted
Because you don’t have relation
film_category
in your from clause