SyntaxFix
Write A Post
Hire A Developer
Questions
One way:
SELECT DISTINCT sc.StoreId FROM StoreClients sc WHERE NOT EXISTS( SELECT * FROM StoreClients sc2 WHERE sc2.StoreId = sc.StoreId AND sc2.ClientId = 5)