mysql - 在结果 MySQL 中格式化 (,)

标签 mysql

大家早上好,

我有一个看起来像这样的表,使用 format() 我可以将 (,) 放在我的 begbalance、存款和取款表上,这些表都是小数。

| begbalance | deposit | withdraw |

SELECT  format(begbalance,2)begbalance,
    format(deposit,2)deposit,
    format(withdraw,2)withdraw, 
    begbalance+deposit+withdraw AS balance
FROM savingstable;

我的问题是我不能使用 format() 平衡,我想把逗号 (,) 放在平衡中。有什么建议吗?提前致谢

最佳答案

format(begbalance+deposit+withdraw, 2) as balance

关于mysql - 在结果 MySQL 中格式化 (,),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19106107/

相关文章:

mysql - 使用 WHERE 和 2 个相互依赖的列表的 SQL 语句

当文件上传为空时,PHP在mysql表中插入空行

mysql - Sql-如何在条件中使用关系字段

mysql - 是否有单独的语言来查询 SQL Server 和 Oracle

mysql - 使用联接、分组依据和全文的 where 子句中的未知列 xxx

php - MySQL 使用 PHP

php - 通过 PHP 在 "per-country/user preference"基础上分离 MySQL 内容

MySQL 使用子查询的当前结果。相关子查询?

mysql - 如何选择 2 小时前的值

mysql - sql中按状态计数列