I want to link an attribute to its product which means link catalog_product_entity to eav_attribute_option_value This is my essay :
SELECT DISTINCT catalog_product_entity_text.value AS nom_du_produit,
sales_flat_order.created_at AS date_de_commande,
sales_flat_order.grand_total AS prix_avant_remise,
sales_flat_order.subtotal AS prix_apres_remise,
sales_flat_order_address.firstname AS prenom,
sales_flat_order_address.lastname As nom,
sales_flat_order_address.telephone AS telephone,
sales_flat_order_address.country_id AS pays
FROM catalog_product_entity cpe,
sales_flat_order,
sales_flat_order_address,
eav_attribute,
eav_attribute_option_value,
catalog_product_entity_text
LEFT JOIN sales_flat_order AS sales
ON (sales.entity_id =
catalog_product_entity_text.entity_id)
LEFT JOIN sales_flat_order_address AS address
ON (address.entity_id =
catalog_product_entity_text.entity_id)
LEFT JOIN catalog_product_entity as sku
on (sku.entity_id = sales.entity_id)
where sales_flat_order.coupon_code like 'xxxxx'
and cpe.sku = '00-000-00' and eav_attribute_option_value.value='Sony';Thanks in advance
Hello @ahmed_chouihi
To solve your issue, you need to link the below three tables:
Hope it helps.
Please please how your answer gonna help me?!