@ Chuck: Which table/tables should I use left join on? I can’t easily see how that would help as there always will be data in all the tables as soon as a user is registered.
@ kylej, thanks for your suggestions. Haven’t tested them yet, been sitting in front of computer to long time, everything is spinning
The second suggestion seems better for me as I would prefer not to have to much code in the "where statement". The query I’m showing here is just a part of the whole query (which have two more tables and more where-statements). Also, the query is built by pretty complex php logic depending on users choices, to keep that code not becoming to complex it would be great if the HAVING statement you suggesting worked.
But as said, my head is spinning, need one nights sleep before I contine testing
Thanks all for your help!
(Btw, more suggestions are welcome
Maybe a subquery in the SELECT could be used for connecting user/group/groupname? Bad idea. )
EDIT: Also tried a subquery as this:
WHERE n.name = ALL (SELECT name FROM `db1`.modx_webgroup_names WHERE name=(’Registered Users’ OR ’OtherRegUsers’))
No error, no result. I’m beginning to believe the problem is... hmmm... some stupid mistake