隨筆 - 6  文章 - 129  trackbacks - 0
          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(14)

          隨筆檔案(6)

          文章分類(467)

          文章檔案(423)

          相冊(cè)

          收藏夾(18)

          JAVA

          搜索

          •  

          積分與排名

          • 積分 - 827168
          • 排名 - 49

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          oracle
          ORA-54033 要修改的列由某個(gè)虛擬表達(dá)式使用      摘要: 要修改的列由某個(gè)虛擬表達(dá)式使用  閱讀全文
          posted @ 2015-09-16 14:30 Ke 閱讀(2820) | 評(píng)論 (0)  編輯
          oracle 十進(jìn)制與十六進(jìn)制的轉(zhuǎn)換      摘要: 十進(jìn)制與十六進(jìn)制的轉(zhuǎn)換
          8i以上版本:
          十進(jìn)制-->十六進(jìn)制
          select to_char(100,'XX') from dual;
          十六進(jìn)制-->十進(jìn)制
          select to_number('7D','XX') from dual;
          其中XX為格式,注意XX的位數(shù)不能小于傳入的參數(shù)。  閱讀全文
          posted @ 2014-07-30 17:35 Ke 閱讀(1441) | 評(píng)論 (0)  編輯
          查出不連續(xù),中斷的流水碼      摘要: select b.SEQ - a.SEQ, b.SEQ, a.SEQ from
          ( select SEQ , ROWNUM RN from (select SEQ from LWH_TEST order by SEQ) ) a,
          ( select SEQ , ROWNUM RN from (select SEQ from LWH_TEST order by SEQ) ) b
          where a.RN+1 = b.RN
          and b.SEQ - a.SEQ > 1  閱讀全文
          posted @ 2011-02-23 15:55 Ke 閱讀(601) | 評(píng)論 (3)  編輯
          Oracle中如何進(jìn)行進(jìn)制轉(zhuǎn)換(轉(zhuǎn))      摘要: create or replace function to_base( p_dec in number, p_base in number )
          return varchar2
          is
          l_str varchar2(255) default NULL;
          l_num number default p_dec;
          l_hex varchar2(16) default '0123456789ABCDEF';
          begin
          if ( trunc(p_dec) <> p_dec OR p_dec < 0 ) then
          raise PROGRAM_ERROR;
          end if;
          loop
          l_str := substr( l_hex, mod(l_num,p_base)+1, 1 ) || l_str;
          l_num := trunc( l_num/p_base );
          exit when ( l_num = 0 );
          end loop;
          return l_str;
          end to_ba  閱讀全文
          posted @ 2010-05-18 09:44 Ke 閱讀(532) | 評(píng)論 (0)  編輯
          oracle 10G正則表達(dá)式      摘要: begin
          if REGEXP_LIKE('%123456kdAAAAa89879456kjdd', '^[[:alnum:]]+$') then
          dbms_output.PUT_LINE('ok');
          else
          dbms_output.PUT_LINE('NG');
          end if;
          end;  閱讀全文
          posted @ 2010-02-20 08:48 Ke 閱讀(309) | 評(píng)論 (0)  編輯
          oracle計(jì)算一年中53個(gè)周分別的起始與結(jié)束日期      摘要: 取得一年中53個(gè)周的開始和結(jié)束日期
          SELECT tab_1.COLUMN_VALUE,
          NEXT_DAY(TO_DATE('0101', 'mmdd'),'星期一') + tab_1.COLUMN_VALUE * 7 - 7 AS first_day,
          NEXT_DAY(TO_DATE('0101', 'mmdd'),'星期一') + tab_1.COLUMN_VALUE * 7 - 1 AS LAST_DAY
          FROM TABLE
          (SELECT SPLIT ('1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53', ',')
          FROM DUAL
          ) tab_1
            閱讀全文
          posted @ 2010-01-22 09:38 Ke 閱讀(1803) | 評(píng)論 (0)  編輯
          oracle nvl(), cont(), decode()函數(shù), case表達(dá)式結(jié)合使用的一條SQL語句      摘要: SELECT nvl(i.tools_model, 'ALL'),
          COUNT(decode(r.maintain_no, 'MAINTAIN', 'MAINTAIN','REPAIR', 'REPAIR', null)) as "維修總次數(shù)",
          COUNT(decode(r.maintain_no, 'MAINTAIN', 'MAINTAIN', null)) as "正常維修次數(shù)",
          COUNT(decode(r.maintain_no, 'REPAIR', 'REPAIR', null)) as "返修次數(shù)",
          case COUNT(decode(r.maintain_no, 'MAINTAIN', 'MAINTAIN','REPAIR', 'REPAIR', null))
          when 0 then 0
          else
          COUNT(decode(r.maintain_no, 'REPAI  閱讀全文
          posted @ 2009-10-29 15:22 Ke 閱讀(676) | 評(píng)論 (0)  編輯
          慎用Oracle的not in (轉(zhuǎn))      摘要: oracle中和null比較的返回值是unkown  閱讀全文
          posted @ 2009-10-20 16:05 Ke 閱讀(265) | 評(píng)論 (0)  編輯
          oracle使用Decode函數(shù)統(tǒng)計(jì)次數(shù)      摘要: count(*) "總次數(shù)",
          count(decode(c.status,0,0,null)) "通過次數(shù)",
          count(decode(c.status,1,1,null)) "異常次數(shù)"   閱讀全文
          posted @ 2009-10-16 14:03 Ke 閱讀(625) | 評(píng)論 (0)  編輯
          oracle 使用多表插入數(shù)據(jù)      摘要: Insert all Insert_into_clause [value_clause] subquery;  閱讀全文
          posted @ 2009-09-12 09:24 Ke 閱讀(908) | 評(píng)論 (0)  編輯
          rowconcat 函數(shù)      摘要: 函數(shù)的參數(shù)為SQL語句,查詢結(jié)果為多列,但返回的結(jié)果為一行一列,值以逗號(hào)隔開  閱讀全文
          posted @ 2009-09-08 08:12 Ke 閱讀(290) | 評(píng)論 (0)  編輯
          not exists      摘要: SELECT NUMINDEX,STRITEMNO,NUMTYPE,STRMODELNAME,TO_CHAR(DTUPDATE,'YYYY/MM/DD HH24:MI:SS') AS DTUPDATE
          FROM ECSM_ITEMNO_INFORMATION e
          where not exists ( select 1 from TBL_SMT_ITEMNO i where i.STRITEMNO=e.STRITEMNO and i.CREATEDATE=e.DTUPDATE )
            閱讀全文
          posted @ 2009-09-07 20:15 Ke 閱讀(222) | 評(píng)論 (0)  編輯
          多行一列轉(zhuǎn)成一行多列的SQL語句      摘要: select max(decode(item,'M',content,'')) "料號(hào)",

          max(decode(item,'D',content,'')) DC,

          max(decode(item,'C',content,'')) LOTNO,

          max(decode(item,'V',content,'')) "廠商名稱",

          max(decode(item,'N',content,'')) "廠商代碼" from T_DISENABLE_MATERIAL_INFO where DOCUMENT_ID=4329
            閱讀全文
          posted @ 2009-09-07 20:12 Ke 閱讀(2857) | 評(píng)論 (0)  編輯
          Java調(diào)用Oracle函數(shù)      摘要: Java調(diào)用Oracle函數(shù)  閱讀全文
          posted @ 2009-05-12 10:27 Ke 閱讀(6370) | 評(píng)論 (2)  編輯

          主站蜘蛛池模板: 基隆市| 临沧市| 墨竹工卡县| 平定县| 收藏| 平舆县| 临泽县| 云霄县| 炉霍县| 新晃| 隆尧县| 绥中县| 澳门| 呼伦贝尔市| 保山市| 佛教| 宁陵县| 弋阳县| 哈尔滨市| 依安县| 健康| 海口市| 屏南县| 邯郸市| 扶绥县| 曲阳县| 富源县| 阿城市| 宜宾县| 黎川县| 察雅县| 临城县| 内乡县| 惠水县| 青海省| 霍林郭勒市| 南岸区| 仲巴县| 孟连| 竹北市| 西贡区|