entonces revisa tus datos con el ejemplo que pones y algunos datos se obtiene lo siguiente:
Código SQL:
Ver originalCREATE TABLE #temp
(
id INT IDENTITY(1,1),
titulo VARCHAR(20),
idarchivo INT,
idarchivo2 INT
)
CREATE TABLE #temp2
(
id INT IDENTITY(1,1),
nombre VARCHAR(20),
tipo VARCHAR(20)
)
INSERT INTO #temp VALUES ('Mio',1,2)
INSERT INTO #temp VALUES ('Mio',3,4)
INSERT INTO #temp2 VALUES ('Test1','Testing')
INSERT INTO #temp2 VALUES ('Test2','Testing')
INSERT INTO #temp2 VALUES ('Test3','Testing')
INSERT INTO #temp2 VALUES ('Test4','Testing')
SELECT t1.id,t1.titulo,t2.nombre,t3.nombre FROM #temp AS t1
LEFT JOIN #temp2 AS t2 ON (t1.idarchivo=t2.id)
LEFT JOIN #temp2 AS t3 ON (t1.idarchivo2=t3.id)
saludos!