prueba con esto:
Código SQL:
Ver originalCREATE TABLE #temp
(
vendedor VARCHAR(5),
factura INT,
interno VARCHAR(3)
)
DELETE FROM #temp
INSERT INTO #temp VALUES ('V1' ,1 ,'si')
INSERT INTO #temp VALUES ('V2' ,2 ,'si')
INSERT INTO #temp VALUES ('V3' ,4 ,'no')
INSERT INTO #temp VALUES ('V3' ,3 ,'no')
INSERT INTO #temp VALUES ('V4' ,1 ,'si')
INSERT INTO #temp VALUES ('V5' ,5 ,'no')
SELECT vendedor,total FROM #temp,
(
SELECT SUM(factura) total FROM #temp WHERE interno='si') AS t1 WHERE #temp.interno='si'
UNION
SELECT vendedor,SUM(factura) AS total FROM #temp WHERE interno='no' GROUP BY vendedor
saludos!