News:

Please note these forums are mostly a testing ground for my SMF work and I don't really use them otherwise.

Main Menu

Paste-1184793377:v:use_geshi-1:v:type-php

Started by Guest, Jul 18, 2007, 09:16 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Guest

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.

Guest

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.