MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Karam Chand Date:July 30 2003 7:34am
Subject:Why LIKE not using INDEX?
View as plain text  
Hello

I have a table with an intger column called ID. I have
an index on it.

Now I want to get a result with all the rows whos ID
values start with lets say 12....i.e. I want all the
IDs with data -

12
123
1234
..........

I am using this query....

select * from tablename where id like '123%'

It is returning me correct results...but the query
does not seem to be using the INDEX?

My question is ... does MySQL not uses INDEX when we
execute a LIKE command on a NUMERIC data....

Is there any better solution to this query?

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
Thread
Why LIKE not using INDEX?Karam Chand30 Jul
Re: Why LIKE not using INDEX?Alec.Cawley30 Jul