以下のようなテーブルがあります。従業員テーブル
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