I am wondering how to write this query.
I know this actual syntax is bogus, but it will help you understand what I am wanting. I need it in this format, because it i
For MySQL, this can be shortened to:
SELECT distributor_id, COUNT(*) total, SUM(level = 'exec') ExecCount, SUM(level = 'personal') PersonalCount FROM yourtable GROUP BY distributor_id