oracle - SQL query to find SUM -
oracle - SQL query to find SUM -
i'm new sql , i've been struggling write query. want find sum of salaries employees in give department, let's 'm', , given hire date, let's '2002', ideas? i'm thinking have bring together tables somehow having trouble, i've set schema this.
jobs table , columns
jobs ------------ job_id salary hire_date
employees table , columns
employees ------------ employee_id name job_id department_id
department table , columns
departments ------------ department_id department_name
this similar way hr schema in oracle think schema should ok need help query now.
you need statement this:
select e.name, d.department_name, sum(j.salary) employees e, departments d, jobs j d.department_name = 'm' , to_char(j.hire_date, 'yyyy') = '2002' , d.department_id = e.department_id , e.job_id = j.job_id grouping e.name, d.department_name;
sql oracle sum schema
Comments
Post a Comment