Código SQL:
Ver originalDROP TABLE #temp
CREATE TABLE #temp
(
total INT,
codigo VARCHAR(20),
kilometraje INT
)
INSERT INTO #temp VALUES (1,'BBSK62', 123046)
INSERT INTO #temp VALUES (1,'BBSK64',65837)
INSERT INTO #temp VALUES (1,'BBSK64',46801)
INSERT INTO #temp VALUES (2,'BBSK65',125772)
INSERT INTO #temp VALUES (2,'BBSK65',103994)
SELECT t1.*,t2.suma FROM #temp AS t1
LEFT JOIN (SELECT SUM(total) suma, codigo FROM #temp GROUP BY codigo) AS t2 ON (t1.codigo=t2.codigo)
saludos!