给出一个员工工资表,列 EmployeeID, Salary, StartDate, 和 EndDate,写一个SQL查询,根据员工的工资在他们工作的每一年,其中1是最高工资每年.
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.