tags:

views:

98

answers:

1

I have a column in mysql of float type, I need to load currency like numbers($300) into this column, how do I do that in MYSQL? (let's not argue about the choice of float for this column)

A: 
  • create temporary table with varchar2 instead of float
  • load file in temporary table
  • copy data from temporary table to real table and use msql functions to convert the currency into a float, using something like:

    (CAST ( SUBSTRING( TRIM( amountStr ), 1 ) AS FLOAT )

ewernli