Assume I have a subscriptions table :
uid | subscription_type ------------------------ Alex | type1 Alex | type2 Alex | type3 Alex | type4 Ben | type2 B
To check if something doesn't exist, use NOT EXISTS(...):
NOT EXISTS(...)
SELECT uid FROM subscribes su WHERE NOT EXISTS (SELECT * FROM subscribes nx WHERE nx.uid = su.uid AND nx.subscription_type = 'type1' ) GROUP BY uid HAVING COUNT(*) > 2 ;