Código SQL:
Ver originalCREATE TABLE #temp
(
id INT,
pagado INT
)
CREATE TABLE #temp2
(
id INT
)
INSERT INTO #temp VALUES (1,1)
INSERT INTO #temp VALUES (2,1)
INSERT INTO #temp VALUES (3,0)
INSERT INTO #temp VALUES (4,1)
INSERT INTO #temp2 VALUES (2)
INSERT INTO #temp2 VALUES (4)
SELECT * FROM #temp AS t
LEFT JOIN #temp2 AS t1 ON (t.id=t1.id)
WHERE t.pagado=1 AND t1.id IS NULL
Saludos!