在ms sql server 2008中计算整数 [英] calculating Integer in ms sql server 2008

查看:135
本文介绍了在ms sql server 2008中计算整数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何计算数字的整数



是说



SET AAA = INT(444.34)

推荐答案

INT将数字向下舍入到最接近的整数: https://msdn.microsoft.com/en-us/library/ee634373.aspx [ ^ ]



它抛弃任何小数部分,正值返回整数部分。在你的例子中,它抛弃.34并返回一个包含444的整数
INT rounds a number down to the nearest integer: https://msdn.microsoft.com/en-us/library/ee634373.aspx[^]

It "throws away" any fractional part and for positive values returns the "whole number" part. In your example, it throws away the ".34" and returns an integer containing "444"


使用CEILING获取下一个更大的整数和FLOOR以获得小于或等于的最大整数到指定的数字。
Use CEILING to get the next larger integer and FLOOR to get the largest integer less than or equal to the specified number.


这篇关于在ms sql server 2008中计算整数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆