OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: How to Query by First Part of a VARCHAR?

From: Dan Nelson (dnelsonallantgroup.com)
Date: Wed Jul 04 2007 - 16:09:36 CDT


In the last episode (Jul 04), David T. Ashley said:
> On 7/4/07, gary <byotekitmail.com> wrote:
> > SELECT column FROM table WHERE column LIKE "CAT\_%";
>
> Would it be reasonable to assume that if "column" is indexed, the
> query would execute quickly, i.e. I would assume that the indexing
> would facilitate this kind of query?

Yes, but only for prefix checks like in this example. ` LIKE "%CAT%" '
or ` LIKE "%CAT" ' can't use an index.

--
        Dan Nelson
        dnelsonallantgroup.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql