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.
>
> Thanks,
> Gary M. Josack
>
>
>
Any difference will come up in an EXPLAIN. To run one, put the word
EXPLAIN in front of the SQL statement:
EXPLAIN sql_statement;
--
Just my 0.00000002 million dollars worth,
Shawn
"Where there's duct tape, there's hope."
"Perl is the duct tape of the Internet."
Hassan Schroeder, Sun's first webmaster
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]