oracle MAX/MIN 分析函数小结
1、通常用法:selectdeptno,empno,ename,sal, MIN(SAL) OVER(partition by deptno orderby hiredate) minsal, MAX(SAL) OVER(partition by deptno orderby hiredate) maxsalfrom emp;DEPTNO EMPNOENAME&nb...
oracle sum()聚合函数
Oracle 的sum聚合函数的功能就是求和(这里暂时不讨论分析函数用法),一般用法不多讲,有个用法比较令人疑惑,曾经也踩过它的坑。示例如下: declare cursor t_cur is select * from emp where empno = 7934 ; v_count number; begin for tm_c...
ORA-14551: cannot perform a DML operation inside a query异常排除
在一个项目中,时不时碰到ORA-14551: cannot perform a DML operation inside a query 错误,定位问题时,发现是在某一个函数的含有for update 的语句抛出异常,这个函数在多个地方调用,调试也没发现异常,后来做了个实验才知道原因,实验如下:create or replace function f_test return numberis l_rec n...