I am trying to build SQL query to select image column, where product_id is coming from 2 different table.
Here is my database schema:
I want to select images of products from ixml_prd_map.id_oc_prd
. I need to get from here to product_image.image
.
On the picture you can see what I am trying to do, here is what I done so far, but it's not working. The error:
Not unique table/alias: 'product'
SELECT product_image.image FROM (product INNER JOIN ixml_prd_map ON product.sku = ixml_prd_map.id_oc_prd) INNER JOIN product ON product_image.product_id = product.product_id