0
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 [email protected]
我被困在使這個查詢使用函數。函數含參數的查詢
翻譯:
harga_triumph = unit price
nilai_desimal = decimal (0.1,0.2)
penyesuaian = adjustment
SQL小提琴:http://sqlfiddle.com/#!9/31244/1
[爲什麼「有人可以幫我嗎?」不是一個實際的問題?](http://meta.stackoverflow.com/q/284236) – EJoshuaS