Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: question on where clause
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....