精选优质文档-倾情为你奉上分别用相关子查询和不相关子查询,查询没有生成过订单的员工姓名.select LastName,FirstNamefrom Employeeswhere not exists(select *from Orderswhere Employees.EmployeeID=EmployeeID)select LastName,FirstNamefrom Employeeswhere EmployeeID in(select EmployeeIDfrom Orderswhere Employees.EmployeeIDOrders.EmployeeID)查询自己下级生成的订单数量最多的员工.(注:每个下级员工的订单数和最多)select employeeidfrom Employeeswhere employeeid in(select employeeidfrom ordersgroup by employeeid having count(orderid)