DECODE(fy_type,1,cs)
DECODE(value,if1,then1,if2,then2,if3,then3,...,else)
sql中decode(...)函数的用法 - 新手娃娃菜 - 博客园
2、to_char() ,to_date()
2.1.日期到字符操作
select sysdate,to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual
select sysdate,to_char(sysdate,'yyyy-mm-dd hh:mi:ss') from dual
select sysdate,to_char(sysdate,'yyyy-ddd hh:mi:ss') from dual
select sysdate,to_char(sysdate,'yyyy-mm iw-d hh:mi:ss') from dual
2.2.字符到日期操作
select to_date('2003-10-17 21:15:37','yyyy-mm-dd hh24:mi:ss') from dual
2.1.日期到字符操作
select sysdate,to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual
select sysdate,to_char(sysdate,'yyyy-mm-dd hh:mi:ss') from dual
select sysdate,to_char(sysdate,'yyyy-ddd hh:mi:ss') from dual
select sysdate,to_char(sysdate,'yyyy-mm iw-d hh:mi:ss') from dual
2.2.字符到日期操作
select to_date('2003-10-17 21:15:37','yyyy-mm-dd hh24:mi:ss') from dual
3、execute immediate v_sql用法
execute immediate v_sql用法_阿亮-CSDN博客
-- execute immediate用法1:立刻执行sql语句
v_sql := 'create or replace view myview as select id,name from student';
execute immediate v_sql;
--- execute immediate用法2:立刻执行sql语句,并赋值给某个变量
v_sql := 'select count(1) from student';
execute immediate v_sql into v_num;
-- execute immediate用法3:带参数的sql
v_sql:='select * from student t where t.name=:1 and t.age=:2';
execute immediate v_sql using 'ZhangSan',23;
在使用execute immediate ‘delete from test’;后记得加上commit;事务提交。不加,在使用PL/SQL进行存储过程测试时,测试完,但数据还是可以查到,原因:commit;缺失。
4、 commit; --提交释放锁
5、NO_DATA_FOUND --如果找不到数据,就会有 数据找不到的异常
https://blog.csdn.net/wodeguozili/article/details/76257383
6、nvl(x,y) 运行机制: 当x不为空,还会计算y。