Change decimal separator in MySQL

Tomas picture Tomas · Dec 29, 2011 · Viewed 70.4k times · Source

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.

Answer

Ome Ko picture Ome Ko · Mar 22, 2012

Tip for CSV exports: SELECT REPLACE(CAST(prijs_incl AS CHAR), '.', ',') will give you input that can be used as numeric fields in european excelsheets.