Search Postgresql Archives

A Not Join

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have three table:
Users - Contains username, ID etc...
Permissions - A permission name and ID
Link up table - The user.id and permission.id

If a user.id and a permission.id row exists in the linkuptable the user have that permission granted.

With the statement below I can see the permissions a user have.

SELECT users.username, permissions.name
FROM users INNER JOIN linkuptable
 ON (users.id = linkuptable.userid)
INNER JOIN permissions
 ON (permissions.id = linkuptable.permissionid)
WHERE users.username = 'DummyUser'

How do I see the permissions that user DON'T have with a fast SQL statement.

Thus, a NOT the statement for the above SQL statement

Regards

Lani


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux