Skip to content
Advertisement

Selecting values used by all identifiers

I have a SQL table which contains UserID and AppID. Now i need a select query which selects all appid’s which are used by all userid’s

For example:

In this example I would only want AppID 35 because it’s used by all UserID’s.

Advertisement

Answer

You can do aggregation :

Use distinct inside count() in case appid has duplicate userid.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement