简单百分比更新

时间:2017-02-14 22:54:42

标签: sql

我需要计算credit_total列以反映invoice_total的10%。我请求社区的帮助。

UPDATE invoices
SET credit_total = '.10'
WHERE invoice_number = 'AX-014-027';

1 个答案:

答案 0 :(得分:5)

使用*

UPDATE invoices
    SET credit_total = invoice_total * 0.10
    WHERE invoice_number = 'AX-014-027';