我有如下所示的表格。员工表
Date Employee ID Employer ID Salary
2/3/2011 10 20 45666
3/12/2009 43 53 2356
雇主表
Employer ID State
53 OH
42 MI
尝试使用 group by 子句按月和按州获得总工资。但没有得到结果。我究竟做错了什么??任何帮助表示赞赏
select date, sum(salary) from employee
group by to_char(date,'MON')
select sum(salary) from employee A, Employer B
where A.employer id=B.employer id
group by B.state
我还需要根据他们的薪水获得前 10 名不同的员工 ID
select DISTINCT employee id from employee
where rownum<=10
order by salary desc