بتاريخ: 22 يوليو 200916 سنة comment_164125 CREATE a matrix query to display the job ,the salary for that job based on department number, and the total salary for that job ,for departments 10 , 50 ,80 , 90 SELECT JOB_ID , sum (case department_id when 20 then (salary) end) "20" , sum (case department_id when 50 then(salary) end ) "50", sum (case department_id when 80 then (salary) end) "80", sum (case department_id when 90 then (salary) end ) "90" , sum (salary) total FROM employees GROUP BY job_id SELECT job_id , Sum (decode ( department_id , 20 , salary) )"20", Sum (decode ( department_id , 90 , salary) )"90", Sum (decode ( department_id , 80 , salary) )"80", Sum (decode ( department_id , 50 , salary) )"50", Sum (salary) “Total” FROM employees GROUP BY job_id تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.