Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我正在设置的内容:
result = price / (case when tax = 0 then @tax1h / 100 else @tax2 / 100 end + 1)
这些是值:
price = 17.5 tax = 1 tax2 = 6
17.5 / (6 / 100 + 1) = 16.5
这将返回 17.5 为什么会发生这种情况以及如何解决?
整数除法:
select (6 / 100 + 1)
上面的结果是1。
然而,结果:
select (6 / 100.0 + 1)
是 1.06。