其他分享
首页 > 其他分享> > 040.hive-floor、round、pmod

040.hive-floor、round、pmod

作者:互联网

(case when b.max_coupon_id is not null then -(floor(abs(a.target_points)/a.coupon_num)+ pmod(a.target_points,a.coupon_num))
when b.max_coupon_id is null then -floor(abs(a.target_points)/a.coupon_num) else null end ) as coupon_points

select -(floor(abs(5)/2)+ pmod(5,2)) , -floor(abs(5)/2),abs(5)/2,pmod(5,2)

 

 

5 /2 

3

2

 

标签:num,floor,pmod,coupon,abs,round,points
来源: https://www.cnblogs.com/star521/p/16165058.html