SQL分隔函数在metabase中不起作用

发布于 2025-01-21 06:30:36 字数 226 浏览 3 评论 0原文

在我的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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

秋心╮凉 2025-01-28 06:30:37

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
enter image description here

甜是你 2025-01-28 06:30:37

它正在解决该值,

就像选择的7/5一样,它将打印1。

It is rounding off the value,

Like for select 7/5 it will print 1.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文