A Not Join

From: L van der Walt <mailing(at)lani(dot)co(dot)za>
To: pgsql-sql(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: A Not Join
Date: 2005-11-01 14:27:01
Message-ID: 43677B35.6010005@lani.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Rawnsley 2005-11-01 14:29:50 Re: Oracle 10g Express - any danger for Postgres?
Previous Message Terry Fielder 2005-11-01 14:17:24 Re: Disappearing Records

Browse pgsql-sql by date

  From Date Subject
Next Message Daryl Richter 2005-11-01 14:45:09 Re: Fwd: Re: Referencing
Previous Message lucas 2005-10-31 19:58:27 Re: Fwd: Re: Referencing