SQL - minus
Posted in 2000
Topics: General Discussion
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
MINUS is not supported in Informix.
You can write it this way instead:
select e.code
from table_1 e
where e.code like 'D%'
and not exists
(select 'x'
from table_2 g
where g.code = e.code
)
Regards,
Frido
"Pietje Puk" <Pietje@puk.com> wrote in message
news:398fcc39$0$95597@news2.zeelandnet.nl...
> 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
>
>
>
>
>
>
>
>
>
Informix doesn't support MINUS function.
The same functionality of MINUS can be used as NOT IN or
NOT EXIST. But if you have millions of rows than the
performance will goes down. For this you can create the
temp table and use the NOT EXIST function.
In article <398fcc39$0$95597@news2.zeelandnet.nl>, "Pietje
Puk" <Pietje@puk.com> wrote:
> 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
* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful