SQL对值取整并且忽略小数点

来源:互联网 发布:美国硕士桥梁课程知乎 编辑:程序博客网 时间:2024/06/08 02:33
(select cast(round(sum(port1.market/1000*secr1.moody_rating_no)/
(select sum(port2.market/1000)
from TblHNWPort port2,TblHNWSecr secr2
where port2.cusip = secr2.cusip
and port2.key_date = secr2.key_date
and port2.port_no=port.port_no),2) as decimal(18,0))
from TblHNWPort port1,TblHNWSecr secr1
where port1.cusip = secr1.cusip
and port1.key_date = secr1.key_date
and port1.port_no=port.port_no
and port1.mod_secr_type not in ('04','05')
and secr1.moody_underlying_rating!='NR')
原创粉丝点击