Código SQL:
Ver originalSELECT * FROM(
SELECT a.*,ROW_NUMBER() OVER(partition BY a.nombre ORDER BY a.nombre) AS rn
FROM temp_base_2 a INNER JOIN temp_base_2 b
ON a.NOMBRE = b.NOMBRE AND a.NUMERO_DOC <> b.NUMERO_DOC
) AS tabla WHERE rn<=2
un poquito de logica.......