Select User who don't own a specific item Tables
 __________                     
|__users__|                     
|_id_|    |                     
| A  |    |                     
| B  |    |     
| C  |    |     
 ---------     


___________________________
|___________owns__________|
|___userId___|___itemId___|
| A          | 1          |
| A          | 2          |
| B          | 1          |
| C          | 2          |
| C          | 3          |
 -------------------------


How do I select the users who don't own item 1.  In this case, it should be user C.
That's typical query, that can be implemented with EXISTS() function:

SELECT
    *                           -- get fields
FROM
    users as u                  -- from users
WHERE
    NOT EXISTS(                 -- where there is no
        SELECT
            TRUE
        FROM
            owns as o           -- owns
        WHERE
            (o.userId = u.id)   -- with this user
            AND
            (o.itemId &lt;&gt; 1)     -- and such item
    );


For multiple items check you can use IN() in condition check of correlated subquery:

SELECT
    *                             -- get fields
FROM
    users as u                    -- from users
WHERE
    NOT EXISTS(                   -- where there is no
        SELECT
            TRUE
        FROM
            owns as o             -- owns
        WHERE
            (o.userId = u.id)     -- with this user
            AND
            (o.itemId IN (1, 3))  -- and items from subset
    );