随笔分类 -  Oracle

摘要:在使用wmsys.wm_concat合并查询结果时,发现中文显示乱码,例如: {TX 此时需要将字段通过to_char转义一下即可。 SELECT t6.username,t6.swjgjc,wmsys.wm_concat(to_char(t6.role_name)) as role_name 阅读全文
posted @ 2021-07-02 12:52 yshy 编辑
摘要:spuuids字段内容为:'08A7A8D9DDF3AB4923428C7883DDBA49,14A44FC2B4EF434C274489FC1DDAA9D9,C055DB766347D6C78854671C7383AC26' SELECT regexp_substr(t.spuuids,'[^,] 阅读全文
posted @ 2020-07-13 14:43 yshy 阅读(2194) 评论(0) 推荐(0) 编辑
摘要:/*第1步:创建ODPS数据表空间 */create tablespace ODPS logging datafile '/home/oracle/tablespace_dir/ODPS.dbf' size 100m autoextend on next 50m maxsize 20480m ext 阅读全文
posted @ 2019-05-05 11:26 yshy 阅读(30964) 评论(0) 推荐(0) 编辑
摘要:1:查出锁定表的信息SELECT s.sid, s.serial#, s.username, s.schemaname, s.osuser, s.process, s.machine,s.terminal, s.logon_time, l.typeFROM v$session s, v$lock l 阅读全文
posted @ 2018-12-13 11:27 yshy 阅读(361) 评论(0) 推荐(0) 编辑
摘要:1:首先创建存储过程 2:定义任务 JOB 每天凌晨执行一次。 对应脚本 阅读全文
posted @ 2018-06-12 16:52 yshy 阅读(306) 评论(0) 推荐(0) 编辑
摘要:前提:在法定节日表(t_fdjr )中维护法定节日包括周六周天 阅读全文
posted @ 2017-06-23 17:01 yshy 阅读(979) 评论(0) 推荐(0) 编辑
摘要:create or replace trigger tri_test before insert on test for each row declare begin if :new.uuid is null then :new.uuid:=sys_guid(); end if; end tri_test; 阅读全文
posted @ 2016-07-11 10:06 yshy 阅读(2674) 评论(0) 推荐(0) 编辑
摘要:>hx_djgrant select on dj_nsrxx to hx_sb;>hx_sbcreate synonym dj_nsrxx for hx_dj.dj_nsrxx; 阅读全文
posted @ 2016-01-05 08:59 yshy 阅读(173) 评论(0) 推荐(0) 编辑
摘要:例如执行一下语句:insert into NSRXT_SP (SP_ID, SP_TITLE, SP_DESC, SP_URL, SP_TYPE, SP_SUB_TYPE, ADD_TIME, CZRY_DM)values (227, '【提醒】新所得税申报表填写小提示', null, 'http:... 阅读全文
posted @ 2015-07-22 08:14 yshy 阅读(433) 评论(0) 推荐(0) 编辑
摘要:--加法 select sysdate,add_months(sysdate,12) from dual; --加1年 select sysdate,add_months(sysdate,1) from dual; --加1月 select sysdate,to_... 阅读全文
posted @ 2015-07-05 09:24 yshy 阅读(7593) 评论(0) 推荐(0) 编辑
摘要:符合条件进行更新操作,不符合则进行插入操作.merge into myd_nsrdt nusing (select '9'as mydtmid,'1'as tmtype,'370200123456788'as nsrsbh,'' as nsrmc, 'sn' as region,4 as pf,'... 阅读全文
posted @ 2015-05-26 08:44 yshy 阅读(360) 评论(0) 推荐(0) 编辑
摘要:--创建事务级别的结果临时表create global temporary table tmp_yshy( c1 varchar2(100), c2 varchar2(100))on commit delete rows;--创建事务级别的存储sql语句的临时表create global tempo... 阅读全文
posted @ 2015-04-04 15:54 yshy 阅读(3303) 评论(0) 推荐(0) 编辑
摘要:SQL> set autotraceUsage: SET AUTOT[RACE] {OFF | ON | TRACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]]SQL> set autotrace onSP2-0618: Cannot find the Session Ide... 阅读全文
posted @ 2015-02-16 15:47 yshy 阅读(347) 评论(0) 推荐(0) 编辑
摘要:SQL> conn scott/tigerERROR:ORA-28002: the password will expire within 1 daysConnected.SQL> conn /as sysdbaConnected.SQL> alter user scott identified b... 阅读全文
posted @ 2015-02-16 13:57 yshy 阅读(263) 评论(0) 推荐(0) 编辑
摘要:-- tanslate(str,from_str,to_str)-- 将str中的from_str替换成to_strselect translate('hello','e','o') tfrom dual;-- instr(str,des_str)-- 可以实现like功能select instr(... 阅读全文
posted @ 2015-02-10 16:45 yshy 阅读(204) 评论(0) 推荐(0) 编辑
摘要:1:实现indexOf功能,.从第1个字符开始,搜索第1次出现子串的位置select instr('->Oracle instr用法','Oracle instr用法',1,1) as i from dual; select instr('oracle','or') as i from dual... 阅读全文
posted @ 2015-01-26 18:03 yshy 阅读(278) 评论(0) 推荐(0) 编辑
摘要:select ano,sum(nvl(dmoney,0)) summoneyfrom( select t2.ano,d.dmoney from ( select t1.*,c.cno from( select a.ano,b.bno from t_a a left j... 阅读全文
posted @ 2015-01-21 21:13 yshy 阅读(1229) 评论(0) 推荐(0) 编辑
摘要:1:update 时做检查使用update mw_contract set payTimes=(case when payTimes>0 then payTimes-1else payTimes end)where contractNo='2015001';2:select时使用select cas... 阅读全文
posted @ 2015-01-21 17:49 yshy 阅读(454) 评论(0) 推荐(0) 编辑
摘要:1:效果如下图所示:表T1:CREATE TABLE T1 ( WEEKWORKID VARCHAR2(20) , DD VARCHAR2(20) ) 表T2CREATE TABLE T2 ( WEEKWORKID VARCHAR2(20) , NR VARCHAR2(20) )SQL语句:... 阅读全文
posted @ 2014-12-27 08:31 yshy 阅读(950) 评论(0) 推荐(0) 编辑
摘要:y@y:~$ sqlplus Error 46 initializing SQL*PlusHTTP proxy setting has incorrect valueSP2-1502: The HTTP proxy server specified by http_proxy is not acce... 阅读全文
posted @ 2014-11-17 17:57 yshy 阅读(2505) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示