Answer the question
In order to leave comments, you need to log in
How to organize a search for similar products?
There is a product and a product category is available
Weight 0.4 kg
Volume 400 ml
Type Anti-dandruff
Filler Citrus
Trademark Head&Shoulders
It is necessary to organize a search for similar products:
I implemented it like this "Weight" is a separate element of the database "0.4 kg" is a separate , the category is a separate id
select DISTINCT pro.id_product , pro.id_feature_value from ps_feature_product as pro
JOIN ps_category_product as cat on pro.id_product = cat.id_product
WHERE pro.id_feature_value = 25663 and cat.id_category = 800
select DISTINCT pro.id_product , pro.id_feature_value from ps_feature_product as pro
JOIN ps_category_product as cat on pro.id_product = cat.id_product
WHERE pro.id_feature_value = 9865 and cat.id_category = 800 and pro.id_feature_value = 9855
Answer the question
In order to leave comments, you need to log in
WHERE pro.id_feature_value = 9865 and cat.id_category = 800 and pro.id_feature_value = 9855
how can pro.id_feature_value be 9865 and 9855 at the same time? means to replace and with or, like so
WHERE cat.id_category = 800 and (pro.id_feature_value = 9865 or pro.id_feature_value = 9855)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question