pl/sql中的case语句
select initcap('dfdsj') from dual;
select replace('ddff','f','') from dual;
select translate('ddff','f','d') from dual;
select substr('asdfjkl',1,4) from dual;
select current_date from dual;
select sysdate from dual;
select concat('010-','88888888')||'转23 高乾竞电话' from dual
select extract(year from sysdate) from dual;
select instr('oracle traning','ra',1,2) instring from dual;
select lpad(rpad('gao',10,'*'),17,'*')from dual;
select rpad('gao',10,'*') from dual;
select replace('1,23,333,000.00',',','') jine from dual;
select trim(' ddd ') from dual;
select to_char(sysdate,'yyyy.mm.dd'),to_char((sysdate)+1,'yyyy.mm.dd') fr
select to_date('2010-01-11', 'YYYY-MM-DD') from dual;
select months_between('19-12月-1999','19-3月-1999') mon_between from dual;
select to_char(trunc(sysdate,'hh'),'yyyy.mm.dd hh24:mi:ss') hh,to_char(trunc(sysdate,'mi'),'yyyy.mm.dd hh24:mi:ss') hhmm from dua
select user from dual;
select deptno,count(*),sum(sal) from scott.emp group by deptno; select decode(1 , 1 , 'x is 1', 2 , 'x is 2', 'others') from dual;
字符串首个字符大写
将字符串中出现的f替换为空,即将f删除
截取字符串从第1-4位即asdf
提取时间的年月日,时分秒的提取非这种写法
查找字符串出现的位置
左粘帖
右粘帖
将字符串中出现的‘,’替换为空,即将‘,’清除
清除左右出现的空格
日期转换为字符
字符转换为日期形式
een from dual;
hh,to_char(trunc(sysdate,'mi'),'yyyy.mm.dd hh24:mi:ss') hhmm from dual;
类似于case语句,即输出为‘x is 1’