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: Michel Cadot <micadot2removethat_at_free.fr>
Date: Thu, 6 Nov 2003 09:15:06 +0100
Message-ID: <3faa02ff$0$261$626a54ce@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 Received on Thu Nov 06 2003 - 02:15:06 CST

Original text of this message

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