oracle
共 6 篇文章
oracle 存储过程调用存储过程
直接调用即可 CHANGE_XX_SALES(CURRENTDATE,result);
2019-10-09 14:01 · oracle · Oracle · 存储过程
截取字段并转为ascii
select t.STAT_ID, ASCII(substr(t.STAT_ID,1,1))||ASCII(substr(t.STAT_ID,2,1))||ASCII(substr(t.STAT_ID,3,1))||ASCII(substr(t.STAT_ID,4,1)) from XXX t
2019-09-18 18:08 · oracle · ascii
oracle 时间相减
oracle 两个时间相减默认的是天数 oracle 两个时间相减默认的是天数 24 为相差的小时数 oracle 两个时间相减默认的是天数 24*60 为相差的分钟数 得到分钟 select (t.STAT_TS-t.OUT_TS)* 24 * 60 from xxx
2019-05-29 23:36 · oracle
从一个表查询出多条数据插入另外一个表
INSERT INTO "YANG"."tb_mrt_rpt_bass_d022" ( select "deal_date","city_code","city_name",'' region_code,'' region_name,'' sm_code,'' sm_name,"ret_num",'' ret_num1,'' ret_num2,'' ret_num3 from "tb_mrt_rpt_bass_d022_copy" ) 要指定列名 有时这样会神奇的报错,解决办法 嵌套一个 select * INSERT INTO "YANG"."tb_mrt_rpt_bass_d022" s…
2018-07-23 17:39 · oracle
left join on and与left join on where的区别
left join on and与left join on where的区别 分享 inner jion没这个特殊性,则条件放在on中和where中,返回的结果集是相同的。 tab1: id psize 1 10 2 20 3 30 表2 tab2: psize name 10 AAA 20 BBB 20 CCC oracle 中 select * from tab1 left join tab2 on tab1.psize = tab2.psize and tab1.psize='10' 这里的先查询tab1.psize的结果,然后条件不为真也会返回左表中的记录 1 10 10 AAA 2…
2012-05-25 22:52 · oracle
oracle 表约束的添加、修改以及约束的禁用启用(转)
--禁用所有外键约束的Sql代码 select 'alter table '||table_name||' disable constraint '||constraint_name||';' from user_constraints where constraint_type='R' --启用所有外键约束的Sql代码 select 'alter table '||table_name||' enable constraint '||constraint_name||';' from user_constraints where constraint_type='R' 执行查询出外键,然后…
2011-12-06 18:40 · oracle