Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: What's this SQL doing?

Re: What's this SQL doing?

From: Anurag Varma <avdbi_at_hotmail.com>
Date: Thu, 06 Nov 2003 13:08:06 GMT
Message-ID: <WIrqb.19745$2A.12254@news01.roc.ny>

"Michel Cadot" <micadot2removethat_at_free.fr> wrote in message news:3faa02ff$0$261$626a54ce_at_news.free.fr...
>
> "Anurag Varma" <avdbi_at_hotmail.com> a écrit dans le message de
> news:oFkqb.3891$QA.779_at_news02.roc.ny...
> >
> > "Prince Of Thieves" <thief_NOSPAM_at_hotmail.com> wrote in message
> news:pskqb.189$373.3675_at_nnrp1.ozemail.com.au...
> > > Select c.clridx, n.price, n.perprice
> > > from clr c, sprice_clrsku n where c.styleidx = 1164
> > > and c.styleidx = c.styleidx and c.active = 1 and c.colouridx > 0 and
> > > n.spidx(+) = 163
> > > and n.clridx(+) = c.clridx order by c.clrcode;
> > >
> > > Notice the line "and c.styleidx = c.styleidx "? Why did the author set this
> > > SQL like this? Is this to accomplish something I do not know about?
> >
> > Maybe the author makes the assumption that 1 sometimes is not equal to 1?
> >
> > Jokes apart .. this does not make sense. strip out the c.styleidx = c.styleidx.
> >
> > Anurag
> >
> > >
> > > --
> > >
> > > Julian Milano
> > >
> > >
> > >
> >
> >
>
> 1 is always equal to 1 but NULL is not equal to NULL, so
> "c.styleidx = c.styleidx" is equivalent to "c.styleidx is not null".
>
> Michel Cadot
>
>

crap :)

Did you look at the condition "where c.styleidx = 1164" ???

and after that do you still consider that clause is required? and if author requires where col is not null .. then code it as such!

Anurag Received on Thu Nov 06 2003 - 07:08:06 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US