469,362 Members | 2,417 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,362 developers. It's quick & easy.

Why LIKE not using INDEX?

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

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 1353

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Bas Scheffers | last post: by
2 posts views Thread by Martin v. Lwis | last post: by
7 posts views Thread by Harris | last post: by
4 posts views Thread by crazy_jutt | last post: by
1 post views Thread by Steffen Stellwag | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.