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 Utah asphalt paving contractors the Right Choice for Your Project?

What Makes Utah asphalt paving contractors the Right Choice for Your Project?

For businesses across Utah, well-maintained asphalt pavement is an important part of daily operations. Commercial parking lots, access roads, loading
7 Signs You Need Professional Asphalt Repair Utah Services

7 Signs You Need Professional Asphalt Repair Utah Services

Commercial parking lots are essential to the daily operations of businesses across Utah. They provide convenient access for customers, employees,
Designing Durable Holders for Electronic Devices 

Designing Durable Holders for Electronic Devices 

Electronic devices often depend on small mechanical parts that receive little attention. A holder may look simple, yet it must
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