Answer the question
In order to leave comments, you need to log in
How can two records be compared in SQL (MySQL) by removing unnecessary things from the records?
It so happened that when entering data into the database, the following situation occurred: there are fields price (accrued) and price_paid (paid), and the amount was entered in price in this way: 99.95 (correct), and in price_paid: 9995.0 (wrong).
Right now I want to fix it, but to do this, display where, according to the idea, price and price_paid are equal and fix it. How can you compare and output them? It doesn't work like this: (price = price_paid)
Answer the question
In order to leave comments, you need to log in
UPDATE table1
SET price = t2.price_paid
FROM table1 as t1
INNER JOIN table2 as t2 ON .t1.priceId = t2.priceId
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question