How come I cannot calculate the running sum on the column I am ordering by?

For example, I have this Candidates table:

    Candidates table:
+-------------+------------+--------+
| employee_id | experience | salary |
+-------------+------------+--------+
| 1           | Junior     | 10000  |
| 9           | Junior     | 10000  |
| 2           | Senior     | 20000  |
| 11          | Senior     | 20000  |
| 13          | Senior     | 50000  |
| 4           | Junior     | 40000  |
+-------------+------------+--------+

I just want to calculate the running sum on the salary for Seniors. This might be a brain fart on my part, but why won’t this query work the way I expect it to:

select *
      , count(employee_id) over (order by salary)
      , sum(salary) over (order by salary)
from Candidates
where experience = 'Senior'

versus

select *
      , count(employee_id) over (order by salary, employee_id)
      , sum(salary) over (order by salary, employee_id)
from Candidates
where experience = 'Senior'

Why do I need to include the extra employee_id in my order by clause?

Related Posts

What Makes Online Game Slots Fun and Easy to Play

What Makes Online Game Slots Fun and Easy to Play

Online gaming platforms may attract attention due to bright graphics, game variety, and account offers. However, these factors say little
How Slot Themes Shape the Way Players Choose Games

How Slot Themes Shape the Way Players Choose Games

Online gaming platforms can look simple from the outside, but the experience depends on several small details. A clear layout,
Why Is QILEE Containerized Reclaimed Water System the Right Choice for Your Factory?

Why Is QILEE Containerized Reclaimed Water System the Right Choice for Your Factory?

The selection of a wastewater reuse system is a realistic option for any factory. The equipment must be suited to
Casino Odds Explained: How Payouts Really Work 

Casino Odds Explained: How Payouts Really Work 

Many people enjoy playing at a Casino for entertainment. Some hope for big wins, while others simply like the excitement