RE: SQL - minus
Posted in 2000
I would do something like
SELECT table_1.code code_1, table_2.code code_2
FROM table_1, outer table_2
WHERE table_1.code=table_2.code
AND table_1.code like 'D%'
INTO temp table wdr with no log;
SELECT code_1
FROM wdr
WHERE code_2 is NULL;
This will give you all entries that are in table_1 but not in table_2
and have a code like 'D%'
Hope this helps,
Will
P.S. I think if these tables are large using 'not in' would be
slow.
>===== Original Message From "Pietje Puk" <Pietje@puk.com> =====
>Hi All,
>
>I've got two customertables, just a little bit different.
>I want to know/see only the custmores that i am missing in the second table.
>
>In Oracle or SQL-server the syntax is something like:
>
>select e.code
>from table_1 e
>where e.code like 'D%'>minus
>select g.code
>from table_2 g
>where g.code like 'D%'>
>What is the syntax for "MINUS" in Informix?
>
>Or doesn't Informix support this?
>
>Allready thanks
>
>Alex
------------------------------------------------------------
This e-mail has been sent to you courtesy of OperaMail, as a free service from
Opera Software, makers of the award-winning Web Browser, Opera. Visit us at
http://www.opera.com/ or our portal at: http://www.myopera.com/ Your free e-mail
account is waiting at: http://www.operamail.com/
------------------------------------------------------------