SQL函数:单行函数,多行函数(分组函数)
字符函数 ascii('a')=>97 chr(65)=>'A' initcap('my word')=>My Word instr('morning,'n',1,1)=>4 length('eric lu han')=>11 lpad('targ',10,'*')=>******targ nls_lower('Me')=>me nls_upper(my word')=> MY WORD regexp_replace() (10g) regexp_substr()(10g) replace('searchstring_10g','searchstring','replacestring')=>replacestring_10g rpad('targ',10,'*')=>targ****** substr('now',1,2)=>no translate('fromto','fromstringtotrans','tostringxxxxxxxxx')=>tostxx 转换(字符,原字符,对应字符)
日期时间函数 add_months(sysdate,-12)=>18-11-03 current_date=>2004-11-18 14:27 当前会话时区所对应的日期时间(9i) current_timestamp 当前会话时区的日期时间(9i) dbtimezone =>+08:00当前数据库所在时区 ...
转换函数 cast(sysdate as varchar2)=>18-11月-04 to_char(sysdate,'YYYY-MM-DD')=>2004-11-18 to_date(sysdate,'DD-MM-YYYY')=>18-11月-04
分组函数 ...
先学习这些,以后在扩充 。多了记不住呀
|