简体   繁体   中英

SQL column update with a calculation

How can I update the values in SQL column using multiplication and then divide it again?

Values of column "price" need to be updated with "price" multiplied by 1.08 and then "price" divide by 1.077

Thanks a lot for the help Andreas

Simply chain the arithmetic:

update t
    set price = price * 1.08 / 1.077;

Multiplication and division can be done in the same operation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM