开发者

parse currency formated number to float in mysql

I have a column in mysql of float type, I need to load curr开发者_Python百科ency 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)


  • 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 )

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜