MySQL Forums
Forum List  »  PHP

Re: Number on a varchar column
Posted by: Peter Brawley
Date: December 22, 2017 03:32PM

In MySQL, when @v='1234abc', @v+0 returns 1234, so if the unwanted chars are appended to the numeric values, all you need is ...

Load Data Infile ...
(col1, col2, col3, ..., @lastcol)
set lastcol=@lastcol+0;

Options: ReplyQuote

Written By
December 21, 2017 11:26AM
December 21, 2017 11:37AM
December 21, 2017 02:34PM
December 21, 2017 04:00PM
Re: Number on a varchar column
December 22, 2017 03:32PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.