SELECT * FROM XYX WHERE VAL IN ('BLUE','RED','GREEN'); query will make it
faster, if the field is ENUM
On Fri, Nov 16, 2012 at 12:36 AM, Anupam Karmarkar
> Hi All,
> Consider a scenario, I have table XYZ which contains value follow
> following are queries we can use get this values
> 1. SELECT * FROM XYX WHERE VAL IN ('BLUE','RED','GREEN');
> 2. SELECT * FROM XYZ WHERE VAL IS NOT NULL
> 3. SELECT * FROM XYZ WHERE VAL = 'BLUE' OR VAL='RED' OR VAL='GREEN'
> and more
> So which one is good in terms of optimization. I guess, 1 and 3 are
> similar in term of formation.
Thanks & Regards,