This query executes as follows:

select distinct ug_user from user_groups where ug_group in ('sysop', 'bureaucrat') and ug_user not in (select distinct ug_user from user_groups where ug_group in ('bot', 'bot-global')) 

@sqlreview