Home > Net >  Filter data in table using MySQL by using similar clause as INTERSECT clause
Filter data in table using MySQL by using similar clause as INTERSECT clause

Time:01-26

enter image description here

By MYSQL, Filtering Products in table where Attribute_Value = "Jane Paul" AND Attribute_Value = "Diamond Publication". This type of query should show result at Book_1 as it is only product where Attribute_Value is matching. What MYSQL Query we can use for this?

CodePudding user response:

Try something like this

SELECT DISTINCT Product 
FROM yourTable 
WHERE Product IN (SELECT Product FROM yourTable WHERE Attribute_value = 'Jane Paul') 
    AND Product IN (SELECT Product FROM yourTable WHERE Attribute_value = 'Diamond Publication')
  •  Tags:  
  • Related