Jump to content

how compare integer to string in mysql query


tcloud

Recommended Posts

I want to perform a query which returns a subset of the fields in a table.  One particular mySQL field is VARCHAR

 

I have a query like this:

$query = mysql_query("SELECT * FROM table WHERE code LIKE '3%') ;

 

It's my understanding this should return all values which begin with "3", but it only returns about a dozen of the values 3, 30-39, 300-399, etc.  (It works with string fields, but this field contains numerals.)

 

Any help appreciated.

 

thanks,

Tom

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.