I’m trying to do this:
SELECT CAST(columnName AS INT), moreColumns, etc
FROM myTable
WHERE ...
I’ve looked at the help FAQs here: http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html , it says I can do it like CAST(val AS TYPE), but it’s not working.
Trying to convert a decimal to int, real value is 223.00 and I want 223
You could try the FLOOR function like this:
You could also try the FORMAT function, provided you know the decimal places can be omitted:
You could combine the two functions