创建departments、employees、salary三张表,
这是我自己写的运行出来姓名为空不知是哪里写错了希望帮忙指正一下:select empname from employees where (select leader from employees inner join departments on employees.deptid=departments.deptid where sex='男' group by leader is not null having count(*)< 3);
你不要用嵌套,用两个join更简单;或者你把表截图发一下,方便看