Tax1 = SELECT a.harga_triumph * b.nilai_desimal
from tbl_detail mc a
JOIN penyesuaian b on a.id=b.id
Tax2 = Tax1 * (c.nilai_desimal from bea_masuk where kode='BM')
Tax3 = c.nilai_desimal from bea_masuk where kode='PPNImpor' * (Tax1 + Tax2)
Tax4 = c.nilai_desimal from bea_masuk where kode='PPNBM' * (Tax3)
Tax5 = c.nilai_desimal from bea_masuk where kode='PRH' * (Tax3)
AllTax = Tax2 + Tax3 + Tax4 + Tax5
Total Price = a.harga_triumph + All Tax
where a.id=@parameter
我坚持使用函数进行此查询。
英文翻译:
harga_triumph = unit price
nilai_desimal = decimal (0.1,0.2)
penyesuaian = adjustment
答案 0 :(得分:0)
我已经通过不使用该函数解决了这个问题,我只是在查询上使用了一个简单的集合,就像这样
set @dectax1 = (select round(nilai_desimal,3) from bea_masuk where id=1;
set @tax1 = (select round(harga_triumph * @dectax1)); from tbl_detail_mc where id=1);
如果要显示结果,请使用@ tax1中的查询。 等等...