我有以下两个表
在员工表中,有以下员工信息:
+-------+-----------+----------------+
| Empid | FirstName | empterritories |
+-------+-----------+----------------+
| 1 | Jhon | North Amercia |
| 2 | Steve | Asia |
+-------+-----------+----------------+
And Orders表存储与订单相关的订单信息
+----------+-------+-------------+
| Order_id | Empid | Adress |
+----------+-------+-------------+
| 1 | 2 | xyz city |
| 2 | 3 | ert country |
+----------+-------+-------------+
我加入这两个表来获取每个员工在以下查询中预订的订单数量;
SELECT employees.FirstName , employees.id , COUNT(orders.OrderID) FROM orders JOIN
employees ON orders.EmployeeID=employees.EmployeeID GROUP BY
employees.FirstName
现在我想编写查询以找出已预订最大订单的员工以及订单号码?但无法找到正确的表达/顺序。 快速修复将受到高度赞赏。