SQL 在整数值上添加逗号分隔符
我有一个查询:
select sum(invoiceamount) as invoice
from fact_salescount
where year in ({YEAR})
and month >= ({FROMMONTH})
and month <= ({TOMONTH})
此查询可以返回 100.00 到 15034115.93 之间的值。它将返回 ONE 值。 我想为每个 000 添加这样的内容:15,034,115.93
我见过很多类似的问题,但没有一个与我的问题相符。我希望有人能帮助我。
我正在使用 Pentaho 和 MySQL,并在 Design Studio 中创建这些查询。
I have a query:
select sum(invoiceamount) as invoice
from fact_salescount
where year in ({YEAR})
and month >= ({FROMMONTH})
and month <= ({TOMONTH})
This query can return a value from 100.00 to 15034115.93. It will return ONE value.
I would like to add, for each 000, like this: 15,034,115.93
I've seen a lot of similar questions, but none match mine. I hope someone can help me out.
I am using Pentaho and MySQL, and creating these queries within the Design Studio.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该可以满足您的要求,但我仍然不喜欢在后端格式化数字。
This should do what you want, but I still don't like formatting number in the backend.