Change decimal separator in MySQL(在 MySQL 中更改小数点分隔符)
问题描述
是否可以将十进制逗号从."更改为(点)到 MySQL 输出中的其他字符(逗号)?我不想使用像 FORMAT 这样的函数,我只想使用我通常使用的所有查询而不做任何修改.我正在寻找一些设置(一些变量、语言环境等).我试图搜索手册但没有成功.
Is it possible to change the decimal comma from "." (dot) to other character (comma) in MySQL output? I don't want to use functions like FORMAT, I just want to use all the queries I normaly use without any modification. I'm looking for some setting (of some variable, locale etc.). I tried to search the manual but without success.
推荐答案
不,你不能.这是 SQL 标准,MySQL 遵守它(至少在这一点上).
No, you can't. That's the SQL standard and MySQL complies with it (in that point at least).
问题实际上不在于输出(正如您提到的,大多数 DBMS 中有各种 FORMAT 函数),而在于 INSERT.如果您可以使用逗号 , 例如作为小数点(这在其他语言环境中很常见),它也用作值分隔符,插入将变得不明确.请参阅我在问题中的回答:insert-non-english-decimal-points-in-mysql
The problem is not really with output (as you mention, there are various FORMAT functions in most DBMSs) but with INSERT. If you could use comma , for example as decimal point (that's common in other locales) which is aslo used as values separator, Inserts would become ambiguous. See my answer in the question: insert-non-english-decimal-points-in-mysql
这篇关于在 MySQL 中更改小数点分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 MySQL 中更改小数点分隔符
基础教程推荐
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 在 SQL 中连接多个表 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 无法解决整理冲突 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
