PLSQL 函数大全

oracle 的一PL/SQL 函数大全
1.字符函数

chr(int) 返回ASCII码
count(string,string) 连接两字符串
initcap(string) 首字母变大写
lower(string) 转换成小写
upper(string) 转换成大写
lpad(string,count[,char]) 在左边添加N个字符或空格
rpad(string,count[,char]) 在右边添加N个字符或空格
ltrim(string[,char]) 去掉串中左边的字符或是空格
rtrim(string[,char]) 去掉串中右边的字符或是空格
replace(string,char[,char]) 替换字符串或是删除字符串
substr(string,start[,count]) 截取字符串
length(string) 串长度

2.数字函数

abs(value) 绝对值
ceil(value) 大于或等于 的最小整数
floor(v) 小于或等于 的最大整数
cos(v) 余弦值
cosh(v) 反余弦值
exp(v) e为底的指数值
ln(v) 自然对数
log(v) 10为底的对数
power(v,exponent) 指数值
round(value,p) 四舍五入
mod(v,divisor) 取余
sort(v) 平方根

3.日期函数

add_months(date,count) 增加count月后的日期
last_day(date) 月末日期
months_between(date1,date2)两日期之间的间隔月份
new_time(date,'this','other')转换时区时间
next_day(date,'day') 星期几的日期
sysdate() 系统日期
current_timestamp() 当前的时间和日期


4.转换函数

to_char(date,'format') 转换成字符串
to_number(char) 转换成数字
to_date(string,'format') 转换成指定格式的日期
chartorowid(char) 字符串转换成rowid
rowidtochar(x) rowid转换成字符

相关文档
最新文档