BWSnippet

Force type using MYSQL

Force type using MYSQL

This can force and integer from a field that is or is not an int

Say you wanted to query a varchar as integer

SELECT 
 CAST( field AS UNSIGNED ) 
 as alias  FROM  table WHERE another_field_id=1111 

Tags

Force type using MYSQL