Exclude certain categories from a flag column
For anyone wondering, the solution was :
p.Categories &amp; (SELECT COALESCE(SUM(IntValue), 0) 
FROM CategoryExceptionByUser 
  LEFT JOIN PCategories 
    ON CategoryExceptionByUser.PCategoryId = PCategories.PCategoryId 
WHERE UserId = @CURRENT_USER) &lt;= 0