posts - 165, comments - 198, trackbacks - 0, articles - 1
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          一句話 技術 (大家來接龍)

          Posted on 2008-07-28 11:02 G_G 閱讀(1276) 評論(1)  編輯  收藏 所屬分類: javaGeneral
          ? 那位來開個頭吧

          正則匹配 html標題

          ??? <[hH]([1-9])>.*?</[hH]\1>

          數據庫查詢執行順序:
          ??? from->where->group by->聚集函數->having->order by
          ??? table level(id,name)
          ??? select count(*) as cu from level where id>1 group by name desc? having cu>=1 order by id ;


          火狐 xpath 取 document dom 值:
          ??? id('table8')/tbody/tr[6]/td/@valign



          數據庫有為空列排放位置:
          ??? 1.? select name,
          ??? ??? ??? ??? ?case
          ??? ??? ??? ??? ???? ??? when name is null then 0
          ??? ??? ??? ??? ???? ??? else? 1?
          ??? ??? ??? ??? ?end
          ??? ??? ??? ??? ??? as is_null
          ???????? from level
          ???????? order by is_null? ;
          ??? 2.select name from level where name is null
          ?????? union
          ????? select name from level where name is not null ;

          數據庫報表表鏈為空項替換為0
          table a (id); values - > 1 ,2 ,3
          table b (id,num); -> (1,15),(1,5)
          查詢結果為 要為
          1??? 20
          2??? 0
          3??? 0

          select?a.id?as?id,
          ????????
          sum(
          ????????????
          case
          ????????????????
          when?b.num?is??null?then?0
          ????????????????
          else?b.num
          ?????????????
          end
          ????????????)?
          as?num
          from?a?left?join?b?on?a.id=b.id?
          group?by?id?;


          評論

          # re: 一句話 技術 (大家來接龍)  回復  更多評論   

          2008-07-28 11:33 by Robin's Java World
          這樣的帖子應該發到論壇里,不該放在Blog中。
          主站蜘蛛池模板: 潮州市| 改则县| 玉环县| 万年县| 宁南县| 寿宁县| 任丘市| 宁强县| 张家港市| 景东| 田阳县| 略阳县| 阜城县| 石楼县| 句容市| 永川市| 怀集县| 华安县| 房产| 时尚| 会理县| 襄樊市| 云和县| 新民市| 彭水| 宜昌市| 页游| 武汉市| 江孜县| 郸城县| 海晏县| 柳州市| 蒙阴县| 高台县| 苏州市| 潮安县| 平南县| 泽普县| 定州市| 徐州市| 连云港市|