oracle常用函数(二)

2014-11-24 11:38:36 · 作者: · 浏览: 3
s specified by format fmt
TRUNC(dt [,fmt] -- truncates dt as specified by format fmt

*******************************************************************************
* Number Functions : *
*******************************************************************************
ABS(num) -- absolute value of num
CEIL(num) -- smallest integer > or = num
COS(num) -- cosine(num), num in radians
COSH(num) -- hyperbolic cosine(num)
EXP(num) -- e raised to the num power
FLOOR(num) -- largest integer < or = num
LN(num) -- natural logarithm of num
LOG(num2, num1) -- logarithm base num2 of num1
MOD(num2, num1) -- remainder of num2 / num1
POWER(num2, num1) -- num2 raised to the num1 power
ROUND(num1 [,num2] -- num1 rounded to num2 decimel places (default 0)
SIGN(num) -- sign of num * 1, 0 if num = 0
SIN(num) -- sin(num), num in radians
SINH(num) -- hyperbolic sine(num)
SQRT(num) -- square root of num
TAN(num) -- tangent(num), num in radians
TANH(num) -- hyperbolic tangent(num)
TRUNC(num1 [,num2] -- truncate num1 to num2 decimel places (default 0)

*******************************************************************************
* String Functions, String Result : *
*******************************************************************************
(num) -- ASCII character for num
CHR(num) -- ASCII character for num
CONCAT(str1, str2) -- str1 concatenated with str2 (same as str1||str2)
INITCAP(str) -- capitalize first letter of each word in str
LOWER(str) -- str with all letters in lowercase
LPAD(str1, num [,str2]) -- left pad str1 to length num with str2 (default spaces)
LTRIM(str [,set]) -- remove set from left side of str (default spaces)
NLS_INITCAP(str [,nls_val]) -- same as initcap for different languages
NLS_LOWER(str [,nls_val]) -- same as lower for different languages
REPLACE(str1, str2 [,str3]) -- replaces str2 with str3 in str1
-- deletes str2 from str1 if str3 is omitted
RPAD(str1, num [,str2]) -- right pad str1 to length num with str2 (default spaces)
RTRIM(str [,set]) -- remove set from right side of str (default spaces)
SOUNDEX(str) -- phonetic representation of str
SUBSTR(str, num2 [,num1]) -- substring of str, starting with num2,
-- num1 characters (to end of str if num1 is omitted)
SUBSTRB(str, num2 [,num1]) -- same as substr but num1, num2 expressed in bytes
TRANSLATE(str, set1, set2) -- replaces set1 in str with set2
-- if set2 is longer than set1, it will be truncated
UPPER(str) -- str with all letters in uppercase

*******************************************************************************
* String Functions, Numeric Result : *
*******************************************************************************

ASCII(str) -- ASCII value of str
INSTR(str1, str2 [,num1 [,num2]]) -- position of num2th occurrence of
-- str2 in str1, starting at num1