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 中将 Float 转换为 Varchar 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 在多列上分布任意行 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
