Bonjour;
j'ai un petit problème avec une requitte mysql (qui 3 jointure ), donc je me trouve perdu dans vague.
alors j'ai 3 table:
catalog_product_entity_varchar
catalog_product_entity
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 value_id int(11) Identity entity_type_id mediumint(8) not null attribute_id smallint(5 not null store_id smallint(5 not null entity_id int(10) not null value varchar(255) not null
catalog_category_product
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 entity_id int(10) identity entity_type_id smallint(8) not null attribute_set_id smallint(5) not null type_id varchar(32) not null sku varchar(64) null category_ids text null created_at datetime not null updated_at datetime not null has_options smallint(1) not null
alors je veux afficher entity_id et value qui on l'attribute_id= 56,70 de la table catalog_product_entity_varchar. jusqu'au là pas de problème.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 category_id int(10) not null product_id int(10) not null position int(10) not null
maintenant je veux joindre (catalog_product_entity_varchar avec catalog_product_entity dans entity_id) et les joindre avec catalog_category_product dans catalog_category_product.product_id = catalog_product_entity.entity_id. voilà ce que j'ai fait (je sais que des bêtises
j'ai eu comme résultat:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 SELECT catalog_product_entity_varchar.entity_id, catalog_product_entity_varchar.value from catalog_product_entity_varchar inner join catalog_product_entity on catalog_product_entity.entity_id=catalog_product_entity_varchar.entity_id inner join catalog_category_product on catalog_category_product.product_id = catalog_product_entity.entity_id where catalog_category_product.category_id=18 and catalog_product_entity_varchar.attribute_id in(56,70)
maintenant, je cherche à voir comme résultat :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 entity_id . value 4 . PALM PALM PDA TX Handheld 4 . /P/A/PALM-TX__new.jpg 5 . HP HP iPAQ 114 CLASSIC HANDHELD 5 . /F/A/FA982AA.jpg 6 . PALM PALM Z22 Handheld 6 . /P/A/PALM-Z22__new.jpgje sais pas si j'ai bien expliqué mais j'espère bien que vous m'aider.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 entity_id . value . value 4 . PALM PALM PDA TX Handheld . P/A/PALM-TX__new.jpg 5 . HP HP iPAQ 114 CLASSIC HANDHELD . F/A/FA982AA.jpg 6 . PALM PALM Z22 Handheld . /P/A/PALM-Z22__new.jpg
Partager