Subject Re: Query slow
Author sivram_mail
Hello,

This left outer join is working fine for me.
But i have to use one where clause in that one.

select * from table1 a left outer join tabl2 b where a.no=b.no and
b.cn is null

This one is fetching the correct result.
This will be fast or what compared to using not in ????
Today i couldn't check it with my volume test database.
Tomorrow i will test it and send the reply.


Thanks

Sivaraman


--- In ib-support@yahoogroups.com, "Ron Black" <rblach1@m...> wrote:
> I'm kind new to this sql stuff so I might be all wrong but would a
left outer join solve the problem ?
> ----- Original Message -----
> From: sivram_mail
> To: ib-support@yahoogroups.com
> Sent: Wednesday, April 16, 2003 9:52 AM
> Subject: [ib-support] Re: Query slow
>
>
> As Daniel said,
> i can use the Exists also.But my dba is telling that don't use
> subqueries.
> Can i get the desired output without subquery???
>
> Sivaraman
>
>
> --- In ib-support@yahoogroups.com, "Martijn Tonies"
<m.tonies@u...>
> wrote:
> > Ah, that question. Did you try the suggestions of the others who
> > responded?
> >
> > --
> > Martijn
> >
> >
> > > Hi Martijn,
> > >
> > > sorry for reposting..
> > >
> > >
> > > this is my query:
> > > -----------------
> > >
> > > Hello,
> > > i have two tables .
> > >
> > > table 1
> > >
> > > id name no
> > >
> > > table 2
> > >
> > > id no
> > >
> > > table 2's id field is referenced to table 1's id field .
> > >
> > >
> > > now i want to retrieve the records from table 1 and no not in
> > > table 2.
> > >
> > > this is the query which is written:
> > > -----------------------------------
> > > select * from table1 where id not in
> > > (select id from table2,table1 where table1.no=table2.no )
> > >
> > > In this query , there is no join condition for primary key.
> > >
> > >
> > > If i rearrange this query to
> > >
> > > select * from table1 a where
> > > a.id not in (select id from
> > > table2 b where a.id=b.id and a.no=b.no)
> > >
> > >
> > > Will it work fine????
> > > And my dba is telling that don't use "ot in".
> > > without "not in" how can i write this query??
>
>
> Yahoo! Groups Sponsor
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
>
>
> [Non-text portions of this message have been removed]