Don't know beans about structuring queries.
What I want to do is run a query which will export its results into files that may be used elsewhere. Desired output is list of matched pairs of usernames and their associated email addresses, like:
username1, email1
username2, email2
etc.
I need to create two lists:
a) List for a specific primary usergroup (#7)
I believe the basic query would be
but don't know how to get this exported into a file.
b) List for a specific secondary membergroup (#12). Users may belong to multiple membergroups, so needs to be able to pick out all members of usergroup 12 even if they are also members of other membergroups.
Don't know how to deal with this as I *think*
.. would only pick out the ones that ONLY belong to 12. (Right?)
Can anybody help me with the required query syntax?
What I want to do is run a query which will export its results into files that may be used elsewhere. Desired output is list of matched pairs of usernames and their associated email addresses, like:
username1, email1
username2, email2
etc.
I need to create two lists:
a) List for a specific primary usergroup (#7)
I believe the basic query would be
Code:
SELECT username, email FROM user WHERE usergroupid=7;
b) List for a specific secondary membergroup (#12). Users may belong to multiple membergroups, so needs to be able to pick out all members of usergroup 12 even if they are also members of other membergroups.
Don't know how to deal with this as I *think*
Code:
SELECT username, email FROM user WHERE membergroupids=12;
Can anybody help me with the required query syntax?
Comment