I have 2 tables in which I record baseball statistics for 2016 and another for 2017.
I have not been able to formulate a Query that adds the statistics of the 2 years of each player and shows it to me in the same way they are shown in the image.
To relate tables you could use inner join
SELECT tabla.dato,
([columna 1] + [columna 2] as tablas_totales
FROM
(SELECT [dato],
sum([campo1]) AS "columna 1"
FROM [dbo].[Ejemplo1]
GROUP BY dato) as tabla_1
inner join
(SELECT [dato],
sum([campo2]) AS "columna 2"
FROM [dbo].[Ejemplo2]
GROUP BY dato) as tabla_2
on tabla_1.dato = tabla_2.dato
ORDER BY tabla_1.dato
You can do the query to the database something like that
SELECT ID, YEAR, NAME, SUM (ATTRIBUTE1), SUM (ATTRIBUTE2), SUM ... FROM (TABLE1) INNER JOIN (TABLE2) USING (ID) WHERE YEAR > = (year_initial) AND YEAR < = (year_final) GROUP BY (ID)
the variables year_final and year_initial specify you.