MSSQL Server 2005数学
函数 1。绝对值
(ABS)
选择fweight-50,ABS(fweight-50)、ABS(5.38)从t_person
2。权力
功率(x,y)用来计算x的y功率。
选择FWeight,权力(FWeight,0.5),电力(fweight,2),
功率(fweight,3),电力(fweight,4)从t_person
选择电源(2,2)
三.平方根
(开方)
选择fweight,sqrt(fweight)从t_person
4。随机数
兰特()
支持参数,并且没有参数。
选择兰德()
选择兰德(123)
5。舍入到最大整数
吸()
选择名、FWeight、吸(fweight)、吸(fweight * 1)从t_person
6。舍入到最小整数
楼()
选择名、fweight,地板(fweight),地板(fweight * 1)从t_person
7。四RMS和五条目
圆()
圆(m,d)m是四和五的值,d是计算精度,即在四rms和五时保留的十进制数字的数目。
d是不保留十进制数的0,d是负的,这意味着整数部分是四舍入和五。
选择名、fweight,圆(fweight,1),圆(fweight * -1,0),圆(FWeight,1)从t_person
8。求正弦值
(罪)
选择名、FWeight、罪(fweight)从t_person
9。余弦值
(COS)
选择名、FWeight、COS(fweight)从t_person
10。反正弦
(在)
选择名、FWeight、阿信(1 / fweight)从t_person
11。反余弦
(ACOS)
选择名、FWeight、ACOS(1 / fweight)从t_person
12。正切值
(谭)
选择名、FWeight、谭(fweight)从t_person
13。求逆切线值
(阿坦)
选择名,FWeight,阿坦(fweight)从t_person
14。两个变量的反正切
atn2(x,y)类似于计算y / x的反正切
选择名、FWeight、atn2(fweight,2)从t_person
15。拜托.
(COT)
选择名、FWeight、床(fweight)从t_person
16。对于pi。
(PI)
选择名、FWeight、fweight * PI,PI()()从t_person
换算17。弧度为角
系统 度()结果的准确性与参数有关。
选择度(pi()),度数(3),度数(3)
换算18。弧度制角度系统
的弧度精度()的结果是相关的参数
(180)选择弧度,弧度(180)
19。符号
符号()返回一个数字符号,如果值大于0,则返回1。
如果值等于0,则返回0,如果值小于0,则返回1。
结果的准确性与参数有关。
选择名、fweight-48.68,标志(fweight-48.68),标志(1),(1)从t_person标志
20。去掉剩下的%
选择名、FWeight、fweight % 5从t_person
21。自然对数
(日志)
选择名、FWeight、日志(fweight),日志(1)从t_person
22。以10为基数的对数
log10()
选择名、Fweight、log10(fweight),log10(100)从t_person
Ps:
程序员的SQL黄金的主要
参考 这个例子已经改变了。
一个t_person
创建表
复制代码代码如下所示:
创建表t_person
(
fidnumber varchar(20),
FName varchar(20),
fbirthday DateTime,
fregday DateTime,
fweight数值(10,2),
)