Código SQL:
Ver originalCREATE TABLE #temp
(
id INT,
facturacion INT,
mes INT,
[YEAR] INT
)
INSERT INTO #temp VALUES (1,10,1,2012)
INSERT INTO #temp VALUES (1,20,3,2012)
INSERT INTO #temp VALUES (1,50,6,2012)
INSERT INTO #temp VALUES (1,30,9,2012)
INSERT INTO #temp VALUES (2,10,9,2012)
INSERT INTO #temp VALUES (2,20,10,2012)
INSERT INTO #temp VALUES (2,60,11,2012)
--Aqui sacas el max, pero sin saber el mes
SELECT
id,MAX(facturacion),[YEAR] FROM #temp GROUP BY [YEAR],id
--Si ocupas saber el mes, entonces puedes hacer algo como esto
SELECT t1.* FROM #temp AS t1
LEFT JOIN (SELECT
id,MAX(facturacion) fact,[YEAR] FROM #temp GROUP BY [YEAR],id) AS t2 ON (t1.id=t2.id AND t1.facturacion=t2.fact AND t1.[YEAR]=t2.[YEAR])
WHERE t2.id IS NOT NULL