Posted by Malcolm Dew-Jones on 05/28/05 07:18
Chris (coverland914@yahoo.com) wrote:
: What wonderful code - talk about slick... :-) don't quite understand
: what the "from table where 1 = 1" is doing (the business with the '1'
: but it sure works great - thanks so much...
WHERE 1 = 1 (i.e. where one equals one)
is always true.
It is the same as having no where clause, except that you can append
something like
" AND name='fred' "
and the statement will still work.
WHERE 1 = 1 AND name='fred'
Otherwise you need to worry about adding the WHERE clause and when to add
the AND.
It is a useful idiom, nothing more.
--
This space not for rent.
Navigation:
[Reply to this message]
|