SyntaxFix
Write A Post
Hire A Developer
Questions
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