Advertisement
t7235
Oct 29th, 2023
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. в конце надо добавить сортировку по employee_last_name
  2.  
  3. SELECT s.last_name AS employee_last_name,
  4. COUNT(c.customer_id) AS all_customers
  5. FROM staff AS s
  6. LEFT OUTER JOIN client AS c ON s.employee_id = c.support_rep_id
  7. GROUP BY s.employee_id
  8. ORDER BY all_customers DESC, employee_last_name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement