Hi,
Whats the most efficient way of doing a SELECT ... IN on a field of
datatype 'SET' ?
Say you have four types of 'permissions':
- superuser
- poweruser
- normal
- guest
Each user has a field, permissions, of type SET
("superuser","poweruser","normal","guest");
Each "resource" has a field, "AllowAccessIf", as above
Now I need to
SELECT this,that,theother FROM table WHERE permissions IN
("superuser","poweruser","normal","guest");
his works fine if permissions is only one value, eg "superuser"
OR "poweruser", etc. However, if the user is "superuser,normal", then
ofcourse, it wont match...
How do I get around this? I'd prefer NOT to have to have a separate table
of 'permission types' or roles etc, as I feel this would slow the process
down, and also complicate adding, modifying and removing "users"
and "resources".
I'd prefer not to just have to go like IN
("superuser,powersuer,normal", "superuser,poweruser", "superuser,normal",
"normal,guest", "guest,superuser", "poweruser.......)
(The example is kinda simplified so that the question was)...
Siggy
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php