I have a column containing a row. This number, but is saved as a string. A string can begin with 00 or more than two zeros. I need to remove zeros and insert a new value (after deletion) in another column. The problem is that the number of zeros at the beginning is not fixed. It may be 2 or more. Is it possible to complete this task with MySQL? How?
Good advice is provided here :
UPDATE your_table SET column2 = TRIM(LEADING '0' FROM column1)
assuming the original value is stored in column1 and you want to write 0-trimmed to column2
column1
column2
you can use CONVERT(col,UNSIGNED INTEGER) to convert it to a number that leading zeros should remove.
CONVERT(col,UNSIGNED INTEGER)
may be
insert into <table> values(select CONVERT(col,UNSIGNED INTEGER),..... from <table2>);