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 <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- 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 <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php