Skip to content
Advertisement

How to filter rows that has multiple condition MySQL

I have a table that contains my product details

Now I want to write a query that gives me product_id(s) with this conditions:

  1. Brand = Intel
  2. model = Core i7

I’ve tried this one but it didn’t returns any rows, I guess I should use JOIN.

Advertisement

Answer

Use group by and having:

Or better yet, using tuple equality:

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement