I have a table called frequents with 2 columns, drinkers and the bars they frequent.
I currently have answered this statement:
Drinkers who frequent at least 2 bars
With the following query:
SELECT DISTINCT drinker
FROM frequents f
WHERE EXISTS(
SELECT drinker
FROM frequents y
WHERE y.drinker=f.drinker
AND f.bar<>y.bar);
I am trying to modify this query to answer the following:
Drinkers who frequent exactly two bars
but I am stuck as to what modifications to my logic must be implemented to satisfy this statement.