--絕對值
select "abs"(-123) from dual;-->123
--向上取整
select "ceil"(123.22) from dual;-->124
select "ceil"(-123.22) from dual;-->-123
--向下取整
select "floor"(123.22) from dual;-->123
select "floor"(-123.22) from dual;-->-124
--取餘數
select "mod"(5, 2) from dual;-->1
--判斷正負
select "sign"(12) from dual;-->1
select "sign"(-12) from dual;-->-1
--開平方
select "sqrt"(16) from dual;-->4
--冪select "power"(3, 4) from dual;-->81
--取固定位數
select "trunc"(12.123, 2) from dual;-->12.12
select "trunc"(12.123) from dual;-->12
--根據ascii碼返回字元
select "chr"(65) from dual;-->a
--四捨五入
select "round"(467.37, 1) from dual;-->467.40
select "round"(467.37, -1) from dual;-->470
select "round"(467.37) from dual;-->467
select "round"(467.57) from dual;-->468
--格式化數字
select "to_char"(12.78,'000.000') from dual;--> 012.780
select "to_char"(12.78,'999.999') from dual;--> 12.780
select "to_char"(0.78,'999.999') from dual;--> .780
select "to_char"(0.78,'990.999') from dual;--> 0.780
select "to_char"(1234567980123,'9,999,999,999,990.00') from dual;--> 1,234,567,980,123.00
--fm用於去掉多餘的空格和0
select "to_char"(12.78,'fm000.000') from dual;-->012.780
select "to_char"(12.78,'fm999.999') from dual;-->12.78
select "to_char"(0.78,'fm999.999') from dual;-->.78
select "to_char"(0.78,'fm990.999') from dual;-->0.78
select "to_char"(1234567980123,'fm9,999,999,999,990.00') from dual;-->1,234,567,980,123.00
--美元符號
select "to_char"(12.78,'fm$000.000') from dual;-->$012.780
select "to_char"(12.78,'fm$999.999') from dual;-->$12.78
select "to_char"(0.78,'fm$999.999') from dual;-->$.78
select "to_char"(0.78,'fm$990.999') from dual;-->$0.78
select "to_char"(1234567980123,'fm$9,999,999,999,990.00') from dual;-->$1,234,567,980,123.00
--本地錢字元
select "to_char"(12.78,'fml000.000') from dual;-->¥012.780
select "to_char"(12.78,'fml999.999') from dual;-->¥12.78
select "to_char"(0.78,'fml999.999') from dual;-->¥.78
select "to_char"(0.78,'fml990.999') from dual;-->¥0.78
select "to_char"(1234567980123,'fml9,999,999,999,990.00') from dual;-->¥1,234,567,980,123.00
--返回資料庫所在地區的貨幣碼
select "to_char"(12.78,'fm000.000c') from dual;-->012.780cny
select "to_char"(12.78,'fm999.999c') from dual;-->12.78cny
select "to_char"(0.78,'fm999.999c') from dual;-->.78cny
select "to_char"(0.78,'fm990.999c') from dual;-->0.78cny
select "to_char"(1234567980123,'fm9,999,999,999,990.00c') from dual;-->1,234,567,980,123.00cny
--轉換成16進製制
select "to_char"(255,'fmx') from dual;-->##
select "to_char"(255,'fmxx') from dual;-->ff
select "to_char"(255,'fm*********x') from dual;-->ff
python學習篇,數字型別及操作
總結python的整數和數學中的整數一樣,有正負無大小,既可以是無窮大,也可以是無窮小,在python整數中只需要記住乙個函式就行啦,pow x,y 函式,用來計算x的y次方。pow 2,100 1267650600228229401496703205376另一方面整數還需要了解一些整數的表達方式,...
數字型別的操作
一 內建數值運算操作符 python提供了9個基本的數值運算操作符,如表3.2所示。這些操作符由python直譯器直接提供,不需要引用標準或第三方函式庫,也叫內建操作符。1.x y x與y之和 2.x y x與y之差 3.x y x與y之積 4.x y x與y之商 5.x y x與y之整數商,即不大...
oracle學習筆記(五) SQL操作符
查詢20 age 21的學生資料 select from student where age between 20 and 21 查詢年齡是20或21的學生資料 select from student where age in 20,21 姓氏為張的學生,張二,張三,張四五都符合條件 select ...