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: Michael Gast <mig-sm_at_web.de>
Date: Thu, 06 Nov 2003 10:31:42 +0100
Message-ID: <3FAA14FE.7010202@web.de>


Hi Julian,

Prince Of Thieves schrieb:
> 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?

Once I've seen a similar construction in a customers system. I asked one of the developers for the reason and he told me that the statement dynamically can be extended with filter conditions. To avoid the check if there is already a where clause in the statement included, he installed a where condition which is ever true. So he can extend the statement without checking for the existence of the where clause. In addition he told me that the performence is not affected by such a where clause.

Could be that there is a similar reason.

-- 
Mit freundlichen Grüßen / Best regards
Michael Gast
SEPP MED GmbH

All emails sent to this address are never read and never will be
answered. Sorry, but until someone cleans up the spam mess, that's the
way it has to be.

E-Mails, die direkt an diese Adresse geschickt werden, lese und
beantworte ich nicht. Ich bedauere diesen Umstand sehr, kenne derzeit
aber keine bessere Möglichkeit, um die Spam-Flut abzustellen.
Received on Thu Nov 06 2003 - 03:31:42 CST

Original text of this message

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