is it possible to convert string into float when importing a csv file into mysql?

Use the REPLACE() string function, twice; once to replace the dots with nothing, once to replace the decimal comma with a dot, and cast that expression to float – like in this small demo example using your first literal in that format:

WITH indata(s) AS (
  SELECT '834.342.314,00' FROM dual
  CAST(REPLACE(REPLACE(s,'.',''),',','.') AS FLOAT) AS f 
FROM indata;
-- out      f     
-- out -----------
-- out  834342314

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top