Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2003

    Question Unanswered: Calculation of Percentage

    Does anybody know how to solve this problem?

    I have a table employees(emp_id, branch, num_error)

    I need to group the table by branch, then by emp_id. Then, I need to calculate the percentage of a particular employee over his branch and over the entire company.

    Please help!. Thank you for your time.

  2. #2
    Join Date
    Jun 2003
    West Palm Beach, FL
    Try this (8i+):

    select branch, emp_id
    ,ratio_to_report(count(*)) over(partition by emp_id) as emp_pct
    ,ratio_to_report(count(*)) over() as branch_pct
    from employees
    group by branch, emp_id

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts