select @控除所得 = convert(decimal, floor(@賃金 / 切捨単位) * 切捨単位 * 定率係数) + 定額賃金 - 定額控除 from mtbl控除給与 where 賃金以上<=@賃金 AND 賃金未満>@賃金 AND 運用区分=@運用区分