Here's a SQL query that should give you the desired result:

```
SELECT 
  EmployeeID, 
  Salary, 
  StartDate, 
  EndDate, 
  DENSE_RANK() OVER (PARTITION BY EmployeeID, YEAR(StartDate) ORDER BY Salary DESC) AS SalaryRank 
FROM EmployeeSalaries;
```

This query uses the DENSE_RANK() window function to assign a salary rank to each employee within each year they have worked. The PARTITION BY clause splits the data into groups by EmployeeID and the year of their StartDate. The ORDER BY clause sorts the salaries in descending order within each group. The result is a table that includes the EmployeeID, Salary, StartDate, EndDate, and SalaryRank columns.
Data una tabella degli stipendi dei dipendenti con le colonne EmployeeID, Salary, StartDate e EndDate, scrivi una query SQL per classificare i dipendenti in base al loro stipendio entro ogni anno in cui hanno lavorato, dove 1 è lo stipendio più alto per ogni anno.