I have a table with a composite key like this:
========TABLE========
key_a_col | key_b_col
Scenario:
key_b is 'foo', and there is a 'bar' and 'baz' entry under key_a for it. Another key_b 'fiz' has 'bar' and 'raz'.
Like this:
========TABLE========
key_a_col | key_b_col
'bar' | 'foo'
'baz' | 'foo'
'bar' | 'fiz'
'raz' | 'fiz'
I want to select all key_b entries where there is both a 'bar' and a 'baz' paired with it in key_a_col. So 'foo' would be returned (bar|foo and baz|foo exist), while 'fiz' would not (only fiz|bar matches).
How can I make this happen?