posts - 431,  comments - 344,  trackbacks - 0
          很多時候會遇到排序或者聯合處理clob類型數據, 而clob數據又不支持這兩種操作, 所有需要把其轉換為字符串來進行處理.
          dbms_lob.substr(clobcloum,2000,1)

          select id, name, coden
            from cims_supplier
           where name like 'A%'
             and coden like 'A%'
          union
          select cdbregno      as id,
                 dbms_lob.substr(supplier_name,2000,1) as name,
                 coden         as coden
            from acdsupplier_moltable
           where supplier_name like 'A%'
             and coden like 'A%'

          cims_supplier表中的name是varchar2類型, 而acdsupplier_moltable表中的supplier_name為clob類型, 這樣就可以union了.
          當然排序也可以了.
          select * from t1 order by dbms_lob.substr(clobcloum,2000,1);

          posted on 2009-06-03 15:11 周銳 閱讀(2655) 評論(0)  編輯  收藏 所屬分類: MySQLOracleSQL Server
          主站蜘蛛池模板: 炉霍县| 崇礼县| 即墨市| 松阳县| 宝应县| 从化市| 轮台县| 嵊州市| 太仓市| 苍山县| 确山县| 濉溪县| 梁山县| 临沭县| 邳州市| 柳林县| 和平区| 天津市| 三原县| 汶上县| 乌兰浩特市| 达州市| 崇仁县| 靖州| 吴川市| 辽宁省| 红桥区| 景德镇市| 阿克陶县| 永城市| 新乐市| 德州市| 开江县| 金塔县| 冀州市| 北票市| 本溪市| 海林市| 茶陵县| 偃师市| 信宜市|