I have three tables: clubs, users and permissions. clubs contains a
Club_ID (an integer). users contains a User_ID. Permissions contains both
as well as a Subjects field (a boolean).
Now, a user is allowed to edit the data associated with a club if he has a
record in the permissions table (with the appropriate User_ID and
Club_ID). He is allowed to edit the subjects if the Subjects field is set.
Now, I want to make one query that given a User_ID will return a list of
all the clubs in clubs with the following three fields:
1. Club_ID
2. Whether a record exist in Permissions.
3. If so, whether the Subjects flag is set (or if 2 is false -
undetermined)
I am using MySQL 3.23.47, but can possibly switch to PostgreSQL.
Regards,
Shlomi Fish
----------------------------------------------------------------------
Shlomi Fish [EMAIL PROTECTED]
Home Page: http://t2.technion.ac.il/~shlomif/
Home E-mail: [EMAIL PROTECTED]
"Let's suppose you have a table with 2^n cups..."
"Wait a second - is n a natural number?"
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]