Mysql:如何获取点后小数位数超过一定数量的每一行 [英] Mysql: How to get every rows that have more than a certain number of decimal after the dot

查看:83
本文介绍了Mysql:如何获取点后小数位数超过一定数量的每一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含浮点值的表.

I have a table that contains float values.

+   id   |  value  |
+--------|---------|
+   1    | 19.22   |
+   2    | 32.333  |
+   3    | 1.2332  |
+   4    | 0.22334 |
+   5    | 4.55    |

我想提取点后每行包含多于3个小数的行.

I want to extract every row that contains more than 3 decimal after the dot.

+   id   |  value  |
+--------|---------|
+   2    | 32.333  |
+   3    | 1.2332  |
+   4    | 0.22334 |

推荐答案

value列作为varchar并使用字符串比较.

Cast the value column as a varchar and use string comparison.

这篇关于Mysql:如何获取点后小数位数超过一定数量的每一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆