MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Jennifer Goodie Date:November 1 2002 2:47am
Subject: How to query a varchar column's value staring with a string?
View as plain text  
select * from theTable where theColumn like 'test%';
or
select * from theTable where LEFT(theColumn,4) = 'test';

depending on the table structure and data and indexing, etc. I have seen a
performance difference between the two, test and see which works best for
your application.


Hi there,

how can I query all the values starting with 'test'?
I tried the following query, but it didn't work

select * from theTable where ( ( theColumn || '%' )
like 'test' );

Thanks,

Andre
mySQL

__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <mysql-thread123741@stripped>
To unsubscribe, e-mail
<mysql-unsubscribe-goodie=apolloi.com@stripped>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Thread
How to query a varchar column's value staring with a string?Andre Kirchner1 Nov
  • How to query a varchar column's value staring with a string?Jennifer Goodie1 Nov
    • Re: How to query a varchar column's value staring with a string?Andre Kirchner1 Nov
      • Re: How to query a varchar column's value staring with a string?Andre Kirchner1 Nov