在 MySQL 中更改小数点分隔符

Change decimal separator in MySQL(在 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 中更改小数点分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Hibernate reactive No Vert.x context active in aws rds(AWS RDS中的休眠反应性非Vert.x上下文处于活动状态)
Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
Flask + PyMySQL giving error no attribute #39;settimeout#39;(FlASK+PyMySQL给出错误,没有属性#39;setTimeout#39;)
auto_increment column for a group of rows?(一组行的AUTO_INCREMENT列?)
Sort by ID DESC(按ID代码排序)
SQL/MySQL: split a quantity value into multiple rows by date(SQL/MySQL:按日期将数量值拆分为多行)