Recently, a colleague approached me to help with building an SQL query. It was an interesting problem in my opinion and the solution to it is quite generic and can be applied to many similar problems.

My colleague had a table of producers and consumers, where consumer to producer was a many-to-many relationship. She wanted to get all consumers which interacted with at least all the producers from a given list.

#sql 

Make SQL Queries With Multiple 'AND' Conditions
5.20 GEEK