Someone entered a ton of numeric data into a table with the sign backwards.
Is there a clean way to flip the sign in the numeric column with a SQL statement?
SQL Server REVERSE() Function The REVERSE() function reverses a string and returns the result.
As Tyson said, just multiply by -1. positive values become negative ( 1 * -1 = -1).
The LIKE operator is used in a WHERE clause to search for a specified pattern in a column. There are two wildcards often used in conjunction with the LIKE operator: The percent sign (%) represents zero, one, or multiple characters. The underscore sign (_) represents one, single character.
update my_table
set amount = -amount
where <whatever>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With