I'm having difficulty wrapping my head around this query. I have a table with a bunch of user features, and I'm trying to get all the users that have no features turned on. I know I need to do something with COUNT and GROUP BY, but SQL is really not my strong suit, and this needs to be done sooner rather than later, otherwise I'd do more research on my own. This is the table structure:
| UserFeatureID | UserID | FeatureID | Active
-----------------------------------------------
| 1 | 1 | 1 | false
| 2 | 1 | 2 | true
| 3 | 2 | 1 | false
| 4 | 2 | 2 | false
| 5 | 3 | 1 | false
| 6 | 3 | 2 | false
| 7 | 4 | 1 | true
| 8 | 4 | 2 | true
So the list of user ID's it'd return is 2 & 3 since they are the only ones that have all features turned off. Any help is appreciated, thank you!
Active
is a bit column you shouldn't use strings to represent the values. :-)