SQL分隔函数在metabase中不起作用
在我的metabase中,我编写了一个查询选择10/5
它显示结果 2.000000000 是正确的。
但是,当我编写选择5/10
时,它显示了结果 0.000000000 。结果应显示 0.500000000 。
你能解释一下吗?为什么分隔功能不起作用?
In my Metabase, I wrote a query SELECT 10/5
It showing a result 2.000000000 which is correct.
But When I wrote SELECT 5/10
It showing a result 0.000000000. The result should show 0.500000000.
Can you explain it? Why divide function is not working?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
metabase可以解析SQL不同的方式。这取决于连接器类型。
但是在大多数情况下,结果取决于数据类型。
您的示例使用 integer disecom ,因为两个操作数都是整数。
您可以尝试更改数据类型

Metabase can parse SQL different ways. It depends on connector type.
But in most cases, the result depends on the data type.
Your example uses integer division, because both of operands are integer.
You can just try to change the data type

它正在解决该值,
就像选择的7/5一样,它将打印1。
It is rounding off the value,
Like for select 7/5 it will print 1.