I want to select data from the below table as per matching of two columns with multiple conditional checks.
I want to check conditions like the following.
When product_category_variants_id = 1 and product_category_variants_value_id = 2 and again product_category_variants_id = 2 and product_category_variants_value_id = 5. Then I need to get out put 8,7 and 6.
I tried the following MySQL Query to archive the above result.
SELECT DISTINCT `product_id` FROM `product_variants` WHERE (`product_category_variants_id` = 1 AND `product_category_variants_values_id` = 2) AND (`product_category_variants_id` = 2 AND `product_category_variants_values_id` = 5);
