On Mon, 2008-07-28 at 07:32 -0400, Gary Josack wrote:
> Andrew Martin wrote:
> > Hello,
> > Is it permissible to order a clause such that the search term is the
> > first item (in the clause)?
> > standard:
> > field1 IN (123, 654, 789)
> > in question:
> > 123 IN (field1, field2, field3)
> > I am interested to know if the optimizer treats this any differently
> > if anybody can shed any light on it (except for the obvious difference
> > in the above queries!)
> > Thanks,
> > Andy
> Both are valid syntax where 1 is returned if the expression is equal to
> any of the values in the list. I can't see the optimizer treating these
> any differently.
> Gary M. Josack
Any difference will come up in an EXPLAIN. To run one, put the word
EXPLAIN in front of the SQL statement:
Just my 0.00000002 million dollars worth,
"Where there's duct tape, there's hope."
"Perl is the duct tape of the Internet."
Hassan Schroeder, Sun's first webmaster