Reputation: 429
I am trying to execute following SQL statement on oracle 11g
select product.product_id, category.category_id, product.name, category.description
from product , category
inner JOIN category_prodcut ON category.category_id = category_prodcut.category_id
inner JOIN category_prodcut ON product.product_id = category_prodcut.product_id;
but I get the following error:
ORA-00904: "PRODUCT"."PRODUCT_ID": invalid identifier 00904. 00000 - "%s: invalid identifier" *Cause:
*Action: Error at Line: 56 Column: 32
how to solve this? what is wrong?
the product_id is there because when I do :
select product_id from product;
everything work fine
Upvotes: 0
Views: 945
Reputation: 1269493
I can only imagine that you are trying to write this query:
select p.product_id, c.category_id, p.name, c.description
from category_product cp join
product p
on p.product_id = cp.product_id join
category c
on c.category_id = cp.category_id;
Upvotes: 2