probando con los ids(solamente) obtenemos algo como esto:
Código SQL:
Ver originalCREATE TABLE #temp
(
id INT
)
CREATE TABLE #temp2
(
id INT
)
INSERT INTO #temp VALUES (100202)
INSERT INTO #temp VALUES (100272)
INSERT INTO #temp VALUES (100598)
INSERT INTO #temp VALUES (102763)
INSERT INTO #temp2 VALUES (100202)
INSERT INTO #temp2 VALUES (100272)
INSERT INTO #temp2 VALUES (100598)
SELECT CASE WHEN t2.id IS NULL THEN 'Producto Nuevo' ELSE CONVERT(VARCHAR(10),t1.id) END AS campo FROM #temp AS t1
LEFT JOIN #temp2 AS t2 ON (t1.id=t2.id)