House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / ColdFusion Talk (CF-Talk)

WHERE Left(str,5) = 'string' VS WHERE str LIKE 'string%'

Author:
Michael Grant
09/08/2010 08:18 PM

Getting to actually test this hasn't been as easy as I'd hoped. If I can get something definitive I'll post. On Wed, Sep 8, 2010 at 3:45 PM, W > > mike, > > Please let us know what you find out.  I'm very curious of this myself.  As > the document clearly states, mysql will use an index when you use a like > but > don't start the string with a wildcard.  So we know that > Left(str,5) = 'string' VS WHERE str LIKE 'string%'both will use an index. > The question now becomes the cost of using LEFT vs using the LIKE. > > BTW, I assume you meant where left(str, 6) = 'string'. > > >


Search cf-talk

February 04, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29