我想从myTable中选择myNum,其中myNum的小数点后第3个数字大于0。
所以
123.456将被退回。
123.450不会。
(SYBASE)
答案 0 :(得分:1)
SELECT myNum
FROM myTable
WHERE FLOOR(myNum*1000) % 10 > 0
<强>解释强>
看见是相信的,所以给定输入123.456
:
myNum*1000 = 123456.xx (possibly data last 3rd decimal place)
FLOOR(myNum*1000) = 123456
FLOOR(myNum*1000) % 10 = 6, which is greater than zero