需要有3列
税收需要为13%
税额需要添加到InvoiceTotal中,它添加的金额需要存入税栏,InvoiceTotal需要按税额添加并放入总列,但仅当InvoiceTotal更高时然后是0 $如果有欠款
InvoiceTotal是您从中获取数据所需的唯一位置,InvoiceTotal是名为Invoices的表中的一列
以下结构:
InvoiceTotal Tax Total
答案 0 :(得分:2)
听起来你想要这个:
select invoicetotal,
invoicetotal * .13 as tax,
invoicetotal * 1.13 as total
from invoices
where invoicetotal > 0