OPERACIONES CON SELECT

18/08/2005 - 18:31 por CCALLOQUISPE PALOMINO | Informe spam
Hola:
En oracle tu puedes utilizar la siguiente consulta:

select name from emp
minus
select name from emp where C_DistCod='10'

en sql cual es su equivalente

muchas gracias por su ayuda
CCALLOQUISPE
 

Leer las respuestas

#1 Gustavo Larriera [MVP]
18/08/2005 - 18:45 | Informe spam
select Col1 from tableB
MINUS
select Col2 from tableA

puede hacerse en SQL Server así:

SELECT t1.Col1 FROM Table1 AS t1
WHERE NOT EXISTS( SELECT * FROM Table2 AS t2
WHERE t2.Col1 = t1.Col1 )

o también:

SELECT t1.Col1 FROM Table1 AS t1
WHERE t1.Col1 NOT IN( SELECT t2.Col1 FROM Table2 AS t2 )





Gustavo Larriera
Uruguay LatAm
Blog: http://sqljunkies.com/weblog/gux/
MVP profile: http://aspnet2.com/mvp.ashx?GustavoLarriera
Este mensaje se proporciona "COMO ESTA" sin garantias y no otorga ningun
derecho / This posting is provided "AS IS" with no warranties, and confers
no rights.
"CCALLOQUISPE PALOMINO" wrote in message
news:
Hola:
En oracle tu puedes utilizar la siguiente consulta:

select name from emp
minus
select name from emp where C_DistCod='10'

en sql cual es su equivalente

muchas gracias por su ayuda
CCALLOQUISPE

Preguntas similares