mysql - SQL Query & Optimization: With multiple searches in various columns -
i have columns 1,2,3,4,5,6,7,8,9,10 , want search of these numbered columns 1 specific value , name = bob
so:
select * table name = bob , 1="value" or 2="value" or 3="value"
and on..
what efficient , best way of doing this? , in instance columns numbered in example, there way index inside query loop 1-10?
thank you.
instead of using or
use union
.
something this:-
select * table name = bob , 1="value" union select * table name = bob , 2="value" union select * table name = bob , 3="value"
Comments
Post a Comment