---------数学函数 1.绝对值S:select abs(-1) valueO:select abs(-1) value from dual 2.取整(大)S:select ceiling(-1.001) valueO:select ceil(-1.001) value from dual 3.取整(小)S:select floor(-1.001) valueO:select floor(-1.001) value from dual 4.取整(截取)S:select cast(-1.00…
oracle分页 select * from (select a1.*, rownum rn from (select *from emp) a1 where rownum<=10) where rn>=6; 首字母大写的的方式显示所以的员工的姓名 第一种方法 1.完成首字母大写 select upper(substr(ename,1,1)) from emp; 2.完成首字母小写 select lower(substr(ename,2,length(ename)-1)) from emp;…
今天写了几个小时的sql语句,一开始我并没有思路,有思路便开始写. 首先我查询了入库表中的3级单位下的各个网点的入库信息,找到这些信息后,我又去入库明细表中查询入库的详细信息 找到了我要的把捆包箱的各个id select * from gzh_instock where outunitid in (select organizationid from cdms_organization start with organizationid='3862fa81-ac03-44de-8e82-d39d…
不多说,看代码 select b.*,a.kscj,a.paiming from (select t.kch,t.kcm,t.kscj,t.xh, rank() over (order by t.kscj desc) paiming //排名用的 from CJ_LRCJB t where t.kch=#{kch} order by kscj desc) a,(select t.kch,t.kcm,count(kscj) as total,max(ks…
有时间要把最近总结的存储过程的问题总结一下,先占坑: create or replace procedure test_proc2 as cursor cur is select YWR,YWRZJH from dyrxx ; --定义游标 TYPE test_type IS TABLE OF cur%ROWTYPE; test_data test_type; v_v1 ); v_v2 ); begin v_v1 :; v_v2 :; -- 打开游标. OPEN cur; --开始循环 LOOP…