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

Home -> Community -> Usenet -> c.d.o.server -> Re: question on where clause

Re: question on where clause

From: <Kenneth>
Date: Sun, 09 May 2004 12:15:50 GMT
Message-ID: <409e1e7f.440533@news.inet.tele.dk>


On 8 May 2004 13:18:20 -0700, jglegare_at_hotmail.com (Jean Legare) wrote:

>Hello:
>
>I've come across a where clause that I haven't seen before.
>
>Select
> table1.column1,
> table2.column2
>from
> table1,
> table2
>where
> 1=1
> and
> table1.column3 = table2.column3
>
>What puzzles me is the first line in the where clause, "1 = 1"
>
>This is always true so why put it in? What purpose does is serve?
>
>Thanks
>
>J

Hi J,

In older days programmers used such statements to "fool" the optimizer to find another access path. At least with Oracle, that is history now. Or should be....

Received on Sun May 09 2004 - 07:15:50 CDT

Original text of this message

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