user1876234 user1876234 - 1 year ago 63
SQL Question

Replace dot with comma on SELECT

I would like to replace any 'dot' character in my query string, on

ing fields from database.

I'll need to modify lots of queries, I'm willing there's a function that will work to all columns on
. I mean something like this

Right now what I have:

SELECT price, lastprice FROM products

OUTPUT: 22.10, 5.24

EXPECTATION: 22,10, 5,25

Answer Source
SELECT REPLACE(price, '.', ',') AS price
FROM products;
  • read more about it here

You have to wrap each column you need to replace with the function. Using replace(*) is not possible.