SQLServer技术(19)

来源:互联网 发布:游戏攻略网站知乎 编辑:程序博客网 时间:2024/05/18 00:45
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

算术函数可对数据类型为整型INTEGER、浮点型FLOAT、实型REAL、货币型MONEY和SMALLMONEY的列进行操作。它的返回值是6位小数,如果使用出错,则返回NULL值并显示警告信息。可以在SELECT语句的SELECT和WHERE子句以及表达式中使用算术函数。Transact-SQL中的算术函数见表4-7。





    例4-37:在同一表达式中使用SIN()、ATAN()、RAND()、PI()、SIGN()函数





    例4-38:用CEILING()和FLOOR()函数返回大于或等于指定值的最小整数值和小于或等于指定值的最大整数值。



    例4-39: ROUND()函数的使用



<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>