Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Newbie question: select row in a table that not exist in other table.
Hi,
1)
select GPRS_CO_MSISDN
from GPRS_SERVICIO_GPRS
where NOT EXISTS (select 1 from SAPN_SERVICIO_APN
where SAPN_CO_MSISDN = GPRS_SERVICIO_GPRS.GPRS_CO_MSISDN )
2)
select g.GPRS_CO_MSISDN from GPRS_SERVICIO_GPRS g, SAPN_SERVICIO_APN a where NOT (g.GPRS_CO_MSISDN = a.SAPN_CO_MSISDN) group by g.GPRS_CO_MSISDN;
Two questions:
Is the result set the same in both queries ?
Why query 1) is faster than query 2 ?
Thanks in advance,
Jose Luis.
Received on Wed Sep 21 2005 - 07:06:35 CDT