March 28, 2009

I need to extract a decimal column from a MySql table but the result must be Integer, cast is not working?

mysql
John B asked:


I need to extract a decimal column from a MySql table but the result must be Integer instead decimal, somebody please??

Filed under Programming & Design by administrator

Permalink Print

Comments on I need to extract a decimal column from a MySql table but the result must be Integer, cast is not working?

March 31, 2009

dhvrm @ 9:36 am

SELECT FLOOR(column) AS column FROM table

SELECT CEILING(column) AS column FROM table

April 1, 2009

Tim C @ 4:14 pm

Try the floor() function

or maybe the truncate() function