count on aggregate function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • erebus
    New Member
    • Sep 2007
    • 6

    count on aggregate function

    Consider an employee table which contains following columns

    employee_id
    employee name
    salary
    account_id
    carrier_id
    employer group_id

    I need to find the sum of salaries grouped by account_id,carr ier_id,employer _group_id.Hope it gets grouped as records having distinct combinations of above mentioned columns(correct me if i'm wrong). I need to find the count of these combinations-DB2 query for the same.
  • dewa81
    New Member
    • Jul 2007
    • 14

    #2
    select account_id,carr ier_id,employer _group_id,count (employee_id) from employee
    group by account_id,carr ier_id,employer _group_id

    Comment

    Working...