I have 3 products. 76,77,78. I want to return rows which have have distinct specifications_id but ALL product must have that specifications_id.
For example: In the image above, 76, 77, 78 each have specifications_id of 1. I would want to return that row.
But in the example of product_id is 76, where it has a specifications_id of 2, the other two products (77,78) do not have a specifications_id = 2.
I know how to do it using a series of loops ect, but I'm curious if there's a shorter way in mysql.
Say this table had several rows and I wanted all the products which had the same specifications_id in all 3 products.