SleePyCode Forums

Special Site & Other Boards => PasteBin => Topic started by: Guest on Jul 18, 2007, 09:16 PM

Title: Paste-1184793377:v:use_geshi-1:v:type-php
Post by: Guest on Jul 18, 2007, 09:16 PM
If you're doing a lot of "OR" selections, it's a quick & dirty way of being able to build the query & test individual bits of it without having to remember whether you've got an "OR" in place or not.  For example:

SELECT * FROM complextable
WHERE 0=1
OR <condition 2>
OR <condition 3>
OR <condition 4>

means you can comment out each condition line while you're testing, and not have to worry about having a leading blank "OR".

c/f "WHERE 1=1" as the first in a series of selection criteria when doing lots of "AND" clause testing.
Title: Paste-1184793421:v:use_geshi-0:v:type-php
Post by: Guest on Jul 18, 2007, 09:17 PM
If you're doing a lot of "OR" selections, it's a quick & dirty way of being able to build the query & test individual bits of it without having to remember whether you've got an "OR" in place or not.  For example:

SELECT * FROM complextable
WHERE 0=1
OR <condition 2>
OR <condition 3>
OR <condition 4>

means you can comment out each condition line while you're testing, and not have to worry about having a leading blank "OR".

c/f "WHERE 1=1" as the first in a series of selection criteria when doing lots of "AND" clause testing.