I have these tables
product
product_id name
51 a
52 b
53 c
54 s
55 e
product_filter
product_id filter_id
52 11
51 22
51 33
52 33
54 11
filter_group_description
filter_group_id filter_id name
1 11 white
1 22 black
2 33 formals
2 44 casuals
filter_group
filter_group_id name
1 Colour
2 Style
What I want here is product name where colour is black or white but style should be formals.
****UPDATE*****
I want to integrate the query in this query:
SELECT DISTINCT oc_product.product_id, oc_product.image, oc_product.name, oc_product_option.option_id, oc_product.price,
ifnull((SELECT oc_product_special.price
FROM oc_product_special
WHERE oc_product_special.product_id = oc_product.product_id
AND '$date1' between oc_product_special.date_start and oc_product_special.date_end),0) as special_price,
ifnull((SELECT DISTINCT avg( oc_review.rating )
FROM oc_review
WHERE oc_review.product_id = oc_product.product_id
GROUP BY oc_product.product_id),0) as rating,
ifnull((SELECT DISTINCT count(
oc_review.product_id)
FROM oc_review
WHERE oc_review.product_id = oc_product.product_id
GROUP BY oc_product.product_id),0) as rated
FROM oc_product, oc_product_to_category, oc_product_option, oc_review $from
where oc_product_option.product_id = oc_product.product_id
AND oc_product_to_category.category_id = $category_id
AND oc_product_to_category.product_id = oc_product.product_id
bis black and white, but isn't formal. The only formal one iss, but it's only white. Can you please show your expected results?