Thanks to all answers above!
I have over 130, 972 rows total, there are several float columns with money-like data in.
So today i need to convert those colums to decimal, because we have some troubles with precision.
I used one of solutions above, but the result wasn't exactly that i need, as author said:
You will have to modify the definition of moneyfield, reload the
moneytabletest table, and run the LEFT JOIN query again and again
until no rows come back from the LEFT JOIN query. Once zero(0) rows
come back, you will know what conversion will be safe.
Another one was lucky and the difference records was marked as deleted...
In my case after this operations:
ALTER TABLE `target_table` ADD `dummy_price` decimal(20,2) NOT NULL;
UPDATE `target_table` SET `dummy_price` = CAST(`float_price` as DECIMAL(20,2));
SELECT `float_price`, `dummy_price` FROM `target_table` WHERE round(`float_price`, 2) <> `dummy_price`;
... i got 87 rows, that didn't match.
So i decided just update it like this:
SET `dummy_price` = round(`float_price`, 2)
WHERE round( `float_price` , 2 ) <> `dummy_price`
Well, after that i got all i need. All rounded data from
float_price is eq to
dummy_price, i think its enough.
I think i'll help someone.