Is it possible to select only the id's of the users that have admin role(role id = 3) without using NOT IN(same query with roleid)?   

Each user has different roles(user, manager, admin, etc).  

```
SELECT appUserInGroups.UserId, appRoles.RoleName, appRoles.RoleId
FROM appGroupInRoles 
        INNER JOIN appRoles ON appGroupInRoles.RoleId = appRoles.RoleId 
        INNER JOIN appUserInGroups ON appGroupInRoles.GroupId = appUserInGroups.GroupId 
        INNER JOIN appApplications ON appRoles.ApplicationId = appApplications.ApplicationId
WHERE appGroupInRoles.UserId not in ( SELECT appUserInGroups.UserId
                                        FROM appGroupInRoles 
                                          INNER JOIN appRoles ON appGroupInRoles.RoleId = appRoles.RoleId 
                                          INNER JOIN appUserInGroups ON appGroupInRoles.GroupId = appUserInGroups.GroupId 
                                         INNER JOIN appApplications ON appRoles.ApplicationId = appApplications.ApplicationId
                                          WHERE appGroupInRoles.RoleId = 3)

```

The NOT IN kills performance completely.   

User Roles preview:   

![User Roles preview](https://i.stack.imgur.com/kSsSQ.png)