从列表中获取浮点数
Get floating point numbers from a list
我正在使用具有 amount
类型 DECIMAL(5,2)
字段的 table。该列中的值为
id amount
1 9.00
2 1.83
3 7.01
4 8.00
5 99.85
我必须只获取小数点后非零的列。
从上面的列表中我应该得到
id amount
2 1.83
3 7.01
5 99.85
我应该如何编写查询以获得结果?
我正在使用 MySql 5.6.
猜一猜:
SELECT *
from tblname
where amount=FLOOR(amount)
我正在使用具有 amount
类型 DECIMAL(5,2)
字段的 table。该列中的值为
id amount
1 9.00
2 1.83
3 7.01
4 8.00
5 99.85
我必须只获取小数点后非零的列。
从上面的列表中我应该得到
id amount
2 1.83
3 7.01
5 99.85
我应该如何编写查询以获得结果?
我正在使用 MySql 5.6.
猜一猜:
SELECT *
from tblname
where amount=FLOOR(amount)