Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: WHERE 1 = 1 (any info on this)
I have seen people use this in pseudo-dynamic sql in a beast called SQR. Especially when they have code like ...
select ...
union
select ...
union
select ...
union
select ... limit to your imagination.
Lot of people think that using 1=1 in absence of a valid limiting condition will let them evaluate (and get data from) a union clause where as putting 1=2 will help them avoid ...
I don't hate just because I don't like SQR, I don't like it because until CBO encounters and evaluates 1=2 clause, it still does all the work of selecting etc and that is just a waste.
Raj
**************************************************************************************5
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services ---------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Tue Oct 21 2003 - 11:14:26 CDT