sql 標量函式----->數學函式
函式引數功能
asin、acos、atan
(float_expr)
求float_expr的反正弦、反余弦、反正切
atn2
(float_expr1,float_expr2)
求float_expr1/float_expr2的反正切
sin、cos、tan、cot
(float_expr)
求float_expr的正弦、余弦、正切
degrees
(numeric_expr)
將弧度轉換為度
radians
(numeric_expr)
將度轉換為弧度
exp(float_expr)
求float_expr的指數值
power
(numeric_expr,y)
求numeric_expr的y次方
sqrt
(float_expr)
求float_expr的平方根
log(float_expr)
求float_expr的自然對數
logio
(float_expr)
求float_expr以10為底的對數
abs(numeric_expr)
求numeric_expr的絕對值
geiling
(numeric_expr)
返回大於等於numeric_expr的最小整數
floor
(numeric_expr)
返回小於等於numeric_expr的最大整數
rand
()返回0到1之間的隨機浮點數,可能使用整數表示式指定其初值
pi()
返回常數3.141592653589793
round
(numeric_expr,length)
將numeric_expr小數點後的值四捨五入,保留的小數字數為length
sign
(numeric_expr)
numeric_expr的值為正數、0或負數時分別返回1、0、-1數值
SQL系列函式 數學函式
1.abs函式取數值表示式的絕對值 select abs 40 結果是40 2.ceiling函式取大於等於指定表示式的最小整數 select ceiling 40.5 結果是41 3.floor函式取小於等於指定表示式的最大整數 select floor 40.5 結果是40 4.power函式取...
四 SQL函式 數學函式2
它接受乙個引數,這個引數為待計算正弦值的表示式。如 select fname,fweight,sin fweight from t person它接受乙個引數,這個引數為待計算余弦值的表示式。如 select fname,fweight,cos fweight from t person它接受乙個引...
函式 數學函式
數學函式 abs degrees rand acos exp round asin floor sign atan log sin atn2 log10 sqrt ceiling pi square cos power tan cot radians abs 返回指定數值表示式的絕對值 正值 的數學...