开窗函数可以实现,我试着写了一个(好长时间没用了,估计会有点错误,你试试,有问题的话交流一下)
SELECT
max(t.empname) name,
max(wage) maxWage,
max(sumWage) sumWage,
t.dept
FROM
(
SELECT
e.empname,
w.wage,
e.dept,
sum(wage) over(partition by e.dept) sumWage
FROM
Employee e,
Wage w
WHERE
e.empId = w.empId
)
t
GROUP BY
t.dept
select e.empname from Employee e where e.empId in (select A.ewpId from (select Max(w.wage) , w.ewpId from Wage w) as A )
ORA-03113 end-of-file on communication channel
Cause: An unexpected end-of-file was processed on the communication
channel. The problem could not be handled by the Net8 two-task software. This
message could occur if the shadow two-task process associated with a Net8
connect has terminated abnormally, or if there is a physical failure of the
interprocess communication vehicle, that is, the network or server machine
went down.