我继承了一些SQL代码,其中一部分代码如下:
CASE WHEN
(CAST(CAST(b.xx AS numeric(11, 6))
* CAST(a.ratio AS numeric(11, 6)) AS decimal(10, 0)) % a.mktcoupons =0)
THEN CAST((CAST(b.xx AS numeric(11, 6)) *
CAST(a.ratio AS numeric(11, 6))) / a.mktcoupons AS decimal(10, 0))
ELSE
CAST(( CAST(b.xx AS numeric(11, 6))
* CAST(a.ratio AS numeric(11, 6))) / a.mktcoupons AS decimal(10, 0))
+ (CAST(CAST(b.xx AS numeric(11, 6))
* CAST(a.ratio AS numeric(11, 6)) AS decimal(10, 0)) % a.mktcoupons)
END AS yy
我理解'案例的一般表达,当A然后B其他C结束' 。但是,我很难搞清楚'%'意思?我查了一下'mktcoupons'并且在“mktcoupon”中没有零价值。任何的想法?谢谢!