标签: sql oracle
在这里,我有2个表Employee和Department,数据如下。
所需的输出是
答案 0 :(得分:0)
您可以通过聚合操作简单地JOIN:
JOIN
SELECT d.dname, COUNT(e.empno) as no_employees, max(e.sal) as most_sal FROM Employee e INNER JOIN Department d ON d.deptno = e.deptno GROUP BY d.dname;