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

Exploring the Appeal of lab grown diamonds Auckland and the Rise of man made diamonds in Modern Jewelry

Exploring the Appeal of lab grown diamonds Auckland and the Rise of man made diamonds in Modern Jewelry

Because the demand for moral and sustainable rings maintains to develop, two trends have captured the eye of each purchasers
The Future of Jewelry: Lab Grown Diamond Earrings and Lab Created Diamonds

The Future of Jewelry: Lab Grown Diamond Earrings and Lab Created Diamonds

The jewellery enterprise has gone through a sizeable transformation in recent years, and terms have emerged as recreation-changers: lab grown
Comienza con el diamante: Why Lab Diamonds Are Changing the Way We See Jewellery

Comienza con el diamante: Why Lab Diamonds Are Changing the Way We See Jewellery

Have you ever looked at a sparkling ring and thought, “Wow… but is it really worth that price tag?” You’re