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: scratch head to the SQL statement of where 1=1

Re: scratch head to the SQL statement of where 1=1

From: Andrew Hardy <nobody_at_spam.from.news.AdvanticaTech.com>
Date: Fri, 7 Sep 2001 09:49:22 +0100
Message-ID: <9na1ms$se1$1@sun-cc204.lut.ac.uk>

"Katak" <kahtat_at_yahoo.com> wrote in message news:9n9p8j$fld$1_at_dahlia.singnet.com.sg...
> i mean on what grounds would a person issue
>
> "where 1 = 1"
>
> since this is always true?

This tends to happen if the SQL statement is being 'generated' in some way e.g. depending on user input the statement may have an unknown number of where clauses - it's easier for the programmer to keep adding 'AND blah=blah' statements rather than working out whether they should start with a 'WHERE blah=blah'.

Andy Received on Fri Sep 07 2001 - 03:49:22 CDT

Original text of this message

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