Hi, I have those two tables:
client:
id (int) #PK
name (varchar)
client_category:
id (int) #PK
client_id (int)
category (int)
Let's say I have those datas:
client: {(1, "JP"), (2, "Simon")}
client_category: {(1, 1, 1), (2, 1, 2), (3, 1, 3), (4,2,2)}
tl;dr client #1 has category 1, 2, 3 and client #2 has only category 2
I am trying to build a query that would allow me to search multiple categories. For example, I would like to search every clients that has at least category 1 and 2 (would return client #1). How can I achieve that?
Thanks!