Hello, good, I need to get the information from the department with the largest number of employees and I cannot do it. I attach the code and table, if you can help me, I would appreciate it!
SELECT d.department_name
FROM employees e
inner join departments d
on d.manager_id = e.manager_id
group by d.department_name
having max(e.department_id)=(SELECT max(count((department_id)))
FROM EMPLOYEES
group by department_id)
;
this code does not give me information about anything having yes but I cannot get the name of the department that would be shipping if I am not mistaken I attach photos
You can try it with a
count
and limit logging to a single item withLIMIT 1
.