SQL to get user names with a given profile(s)
ElMazzaXDec 13 2011 — edited Dec 13 2011hi all!
i have this situation:
i have a user table with user_name column
i have a profile_user table that associates user_name with profiles. (with columns: user_name, profile)
each user can have 1 or more profiles.
what i need is to find out users with the profiles i put in my query
example:
table profile_user:
tom, admin
tom, basic_user
pat, full_access
john, basic_user
steve, admin
pat, basic_user
let's say that i want to know who is (admin and basic_user) or (full_access) for example.
how should i build up the query?
many thanks in advance!!!