特定のカテゴリの製品の特定の機能の価値を取得しようとしています。id_category_default は 13 (Processors) で、id_feature は 6 (Power(W)) です。探している出力は次のようになります。
<ProcessorName><ValueOfFeature>
今まで私はこれを試しました:
SELECT pl.name,fvl.value
from ps_product_lang pl,ps_product p,ps_feature_value_lang fvl,ps_feature_value fv,ps_feature f,ps_feature_lang fl
where pl.id_product=p.id_product
and p.id_product in (SELECT id_product
from ps_feature_product
where id_feature in (select id_feature
from ps_feature
where id_feature = 6))
and pl.id_lang = 1
and pl.id_shop = 1
and p.id_shop_default=1
and p.id_category_default =13
and fvl.id_feature_value=fv.id_feature_value
and fv.id_feature=f.id_feature
and fvl.id_lang=1
and fl.id_feature =f.id_feature
and fl.id_lang=1
and f.id_feature=6
出力は次のとおりです。
<ProcessorName1><NameOfFeature><value 1 OfFeature>
<ProcessorName1><NameOfFeature><value 2 OfFeature>
<ProcessorName1><NameOfFeature><value 3 OfFeature>
<ProcessorName1><NameOfFeature><value 4 OfFeature>
<ProcessorName2><NameOfFeature><value 1 OfFeature>
<ProcessorName2><NameOfFeature><value 2 OfFeature>
<ProcessorName2><NameOfFeature><value 3 OfFeature>
<ProcessorName2><NameOfFeature><value 4 OfFeature>
<ProcessorName3><NameOfFeature><value 1 OfFeature1>
etc
<ProcessorName4><NameOfFeature><value 1 OfFeature1>
etc
私が必要とするのは、特定の製品の id_feature=6 値を持つ機能を取得することです:
<processorName1><valueOfFeature>
<processorName2><valueOfFeature>
<processorName3><valueOfFeature>
<processorName4><valueOfFeature>
どんな助けでも大歓迎です!