2009年3月28日

          多線程總結(jié) todo

          http://lavasoft.blog.51cto.com/62575/27069/

          posted @ 2012-03-26 11:06 luofeng225| 編輯 收藏

          異常處理

               摘要:   閱讀全文

          posted @ 2011-07-18 12:09 luofeng225 閱讀(274) | 評論 (0)編輯 收藏

          如何娶到比爾·蓋茨的女兒

               摘要:   閱讀全文

          posted @ 2011-07-18 12:09 luofeng225 閱讀(503) | 評論 (0)編輯 收藏

          Log4j 雜記

               摘要: Log4j 雜記  閱讀全文

          posted @ 2011-07-15 21:13 luofeng225 閱讀(300) | 評論 (0)編輯 收藏

          內(nèi)部類

               摘要: 簡單的說,內(nèi)部(inner)類指那些類定義代碼被置于其它類定義中的類;而對于一般的、類定義代碼不嵌套在其它類定義中的類,稱為頂層(top-level)類。對于一個內(nèi)部類,包含其定義代碼的類稱為它的外部(outer)類。
          成員內(nèi)部類
          局部內(nèi)部類
          匿名類
          靜態(tài)內(nèi)部類  閱讀全文

          posted @ 2011-07-15 09:34 luofeng225 閱讀(262) | 評論 (0)編輯 收藏

          final

               摘要: final  閱讀全文

          posted @ 2011-07-15 09:29 luofeng225 閱讀(224) | 評論 (0)編輯 收藏

          盡量買國外作者出的書。

               摘要: 軟件開發(fā)方面的書籍還是國外作者出的好!  閱讀全文

          posted @ 2011-07-15 09:18 luofeng225 閱讀(344) | 評論 (0)編輯 收藏

          互聯(lián)網(wǎng)不適合螺絲釘員工

               摘要: 中國軟件企業(yè)主要做的是外包類項目,提供行業(yè)應(yīng)用的解決方案。在這種企業(yè)里面,技術(shù)只是一顆螺絲釘,起主導(dǎo)作用的是行業(yè)里經(jīng)驗豐富的人,純做技術(shù)的路很窄。而在國外,技術(shù)人員有很寬闊的發(fā)展路線,可以在技術(shù)領(lǐng)域鉆研得很深。此外,國內(nèi)很多領(lǐng)域的軟件項目,均是利用國外的成型技術(shù),比如數(shù)據(jù)庫用Oracle的、中間件用IBM的。這樣,利潤最厚的部分都被國外企業(yè)掙了。國內(nèi)企業(yè)利潤薄,投入也會小,導(dǎo)致國內(nèi)軟件行業(yè)技術(shù)人員發(fā)展的路也就窄了很多。  閱讀全文

          posted @ 2011-02-25 15:20 luofeng225 閱讀(352) | 評論 (0)編輯 收藏

          35歲:我還能做程序員嗎?

               摘要:   閱讀全文

          posted @ 2009-10-19 18:51 luofeng225 閱讀(1366) | 評論 (3)編輯 收藏

          立足于中間件 迎接美好的SOA時代

               摘要: 即是Service Oriented Architecture簡稱,SOA是一種模式架構(gòu),SOA具體實現(xiàn)目前有多種選擇: Services(Web服務(wù))、CORBA和JINI。因此,WebServices不等于SOA。
            閱讀全文

          posted @ 2009-09-18 19:48 luofeng225| 編輯 收藏

          印度Infosys公司

               摘要:   閱讀全文

          posted @ 2009-09-05 21:23 luofeng225 閱讀(2211) | 評論 (0)編輯 收藏

          Infosys的人才哲學(xué)

               摘要:   閱讀全文

          posted @ 2009-09-05 20:58 luofeng225 閱讀(379) | 評論 (0)編輯 收藏

          從軟件技術(shù)高手到百萬富翁的三條捷徑

               摘要: CSDN總裁蔣濤為來賓做了開場白,他談到了從軟件技術(shù)高手到百萬富翁的三條捷徑。  閱讀全文

          posted @ 2009-09-01 10:41 luofeng225 閱讀(283) | 評論 (0)編輯 收藏

          Red Hat以3.5億美元收購中間件廠商JBoss

               摘要:   閱讀全文

          posted @ 2009-08-08 00:36 luofeng225 閱讀(285) | 評論 (0)編輯 收藏

          迪米特原則

               摘要: 迪米特原則  閱讀全文

          posted @ 2009-07-02 23:15 luofeng225 閱讀(662) | 評論 (0)編輯 收藏

          組合/聚合復(fù)用原則

               摘要: 組合/聚合復(fù)用原則 【5,Composition/Aggregation Reuse Principle(CARP)  閱讀全文

          posted @ 2009-07-02 23:09 luofeng225 閱讀(1329) | 評論 (0)編輯 收藏

          接口隔離原則

               摘要: 接口隔離原則 Interface Segregation Principle(ISP)  閱讀全文

          posted @ 2009-07-02 23:03 luofeng225 閱讀(282) | 評論 (0)編輯 收藏

          依賴倒轉(zhuǎn)原則

               摘要:   閱讀全文

          posted @ 2009-07-02 22:59 luofeng225 閱讀(1159) | 評論 (3)編輯 收藏

          里氏代換原則

               摘要:   閱讀全文

          posted @ 2009-07-02 22:53 luofeng225 閱讀(455) | 評論 (0)編輯 收藏

          開-閉”原則

               摘要:   閱讀全文

          posted @ 2009-07-02 22:36 luofeng225 閱讀(253) | 評論 (0)編輯 收藏

          簡單工廠模式

               摘要: 創(chuàng)建模式之一 簡單工廠模式   閱讀全文

          posted @ 2009-07-02 22:31 luofeng225 閱讀(219) | 評論 (0)編輯 收藏

          異常處理誤區(qū)

               摘要: 好文章,學(xué)習(xí)!  閱讀全文

          posted @ 2009-06-30 00:35 luofeng225 閱讀(244) | 評論 (0)編輯 收藏

          OGNL

               摘要: 它是一種功能強大的表達式語言(Expression Language,簡稱為EL),通過它簡單一致的表達式語法,可  閱讀全文

          posted @ 2009-06-18 17:02 luofeng225 閱讀(225) | 評論 (0)編輯 收藏

          內(nèi)連接,外連接,自然連接

               摘要: 內(nèi)連接

          外連接

          左外連接
          右外連接
          完全外連接
          自然連接
            閱讀全文

          posted @ 2009-06-02 23:24 luofeng225 閱讀(1679) | 評論 (0)編輯 收藏

          Struts.xml

               摘要: 常用,待更新  閱讀全文

          posted @ 2009-05-31 00:16 luofeng225 閱讀(537) | 評論 (0)編輯 收藏

          struts2的struts.properties配置文件詳解

               摘要: Struts 2框架有兩個核心配置文件:
          struts.xml和struts.properties

          其中struts.xml文件主要負責(zé)管理應(yīng)用中的Action映射,以及該Action包含的Result定義等。除此之外,Struts 2框架還包含一個struts.properties文件,該文件定義了Struts 2框架的大量屬性,開發(fā)者可以通過改變這些屬性來滿足應(yīng)用的需求。  閱讀全文

          posted @ 2009-05-30 23:43 luofeng225 閱讀(267) | 評論 (0)編輯 收藏

          傳奇軟件公司Borland被收購

               摘要:   閱讀全文

          posted @ 2009-05-10 19:48 luofeng225 閱讀(281) | 評論 (0)編輯 收藏

          甲骨文CEO埃里森:沒有誰能逃出我的掌握

               摘要:   閱讀全文

          posted @ 2009-05-10 19:44 luofeng225 閱讀(282) | 評論 (0)編輯 收藏

          Yahoo! UI Library簡介

               摘要: Yahoo! User Interface Library(簡稱yui) 是一個使用Javascrīpt編寫的工具和控件庫。它利用DOM腳本,DHTML和AJAX來構(gòu)造具有豐富交互功能的Web程序。  閱讀全文

          posted @ 2009-05-10 19:20 luofeng225 閱讀(832) | 評論 (0)編輯 收藏

          Apache Commons工具集簡介

               摘要: 常用有 commons-logging,F(xiàn)ileUtils,StringUtils,,,,,,,  閱讀全文

          posted @ 2009-05-10 10:20 luofeng225 閱讀(253) | 評論 (0)編輯 收藏

          PL/SQL Developer

               摘要:   閱讀全文

          posted @ 2009-05-08 00:46 luofeng225 閱讀(200) | 評論 (0)編輯 收藏

          object 標簽 -- 在網(wǎng)頁中嵌入除圖片外的多媒體

               摘要: classid -- 關(guān)聯(lián)一個應(yīng)用程序,執(zhí)行嵌入內(nèi)容的應(yīng)用程序在windows系統(tǒng)中的唯一id(不能改變此id,否則程序?qū)⒊霈F(xiàn)異常),  閱讀全文

          posted @ 2009-05-05 00:02 luofeng225 閱讀(876) | 評論 (0)編輯 收藏

          html dl dt dd 標簽

               摘要: html dl dt dd 標簽  閱讀全文

          posted @ 2009-05-04 23:52 luofeng225 閱讀(3816) | 評論 (1)編輯 收藏

          CRUD

               摘要:   閱讀全文

          posted @ 2009-04-28 20:32 luofeng225 閱讀(212) | 評論 (0)編輯 收藏

          Embed標簽

               摘要:   閱讀全文

          posted @ 2009-04-27 00:13 luofeng225 閱讀(251) | 評論 (0)編輯 收藏

          struts2 strus.xml中result類型及含義(轉(zhuǎn))

               摘要:   閱讀全文

          posted @ 2009-04-26 23:08 luofeng225 閱讀(229) | 評論 (0)編輯 收藏

          Struts2 中 Result的 Chain Result,Redirect Action Result,Redirect Result 三者之間的區(qū)別

               摘要: Chain Result,Redirect Action Result,Redirect Result 三者之間的區(qū)別  閱讀全文

          posted @ 2009-04-26 23:04 luofeng225 閱讀(2650) | 評論 (0)編輯 收藏

          Redirect Action Result

               摘要:   閱讀全文

          posted @ 2009-04-26 22:59 luofeng225 閱讀(450) | 評論 (0)編輯 收藏

          RIA(Rich Internet Applications)富互聯(lián)網(wǎng)應(yīng)用

               摘要: 了解 RIA(Rich Internet Applications)富互聯(lián)網(wǎng)應(yīng)用  閱讀全文

          posted @ 2009-04-26 22:25 luofeng225| 編輯 收藏

          基于Web的打印方案比較分析

               摘要:   閱讀全文

          posted @ 2009-04-23 11:58 luofeng225 閱讀(198) | 評論 (0)編輯 收藏

          推薦一款Java反編譯器,比較好用

               摘要: http://www.aygfsteel.com/xmatthew/archive/2008/10/28/237203.html  閱讀全文

          posted @ 2009-04-21 19:43 luofeng225 閱讀(399) | 評論 (2)編輯 收藏

          Oracle(甲骨文)宣布以74億美元收購Sun

               摘要:   閱讀全文

          posted @ 2009-04-21 10:10 luofeng225 閱讀(297) | 評論 (0)編輯 收藏

          UltraEdit, 設(shè)置語法高亮顯示

               摘要: UltraEdit 是一塊非常知名的編輯器,支持的語法達到100余種。可是,支持這么多的語法,你會配置嗎?  閱讀全文

          posted @ 2009-04-17 23:11 luofeng225 閱讀(8020) | 評論 (1)編輯 收藏

          屬性編輯器

               摘要: 屬性編輯器,自定義屬性編輯器  閱讀全文

          posted @ 2009-04-12 23:35 luofeng225 閱讀(266) | 評論 (0)編輯 收藏

          Spring中bean的基本xml配置

               摘要: 裝配bean的不同設(shè)置方式,
            閱讀全文

          posted @ 2009-04-12 23:05 luofeng225 閱讀(926) | 評論 (0)編輯 收藏

          Singleton(單態(tài))

               摘要: Singleton(單態(tài))設(shè)計模式  閱讀全文

          posted @ 2009-04-11 01:46 luofeng225 閱讀(221) | 評論 (0)編輯 收藏

          Strategy(策略)

               摘要: Strategy 設(shè)計模式  閱讀全文

          posted @ 2009-04-11 01:35 luofeng225 閱讀(200) | 評論 (0)編輯 收藏

          認識設(shè)計模式

               摘要: 簡單認識設(shè)計模式  閱讀全文

          posted @ 2009-04-11 01:09 luofeng225 閱讀(209) | 評論 (0)編輯 收藏

          關(guān)于程序員

               摘要: 軟件程序員尤其需要規(guī)劃!!  閱讀全文

          posted @ 2009-04-10 20:13 luofeng225 閱讀(246) | 評論 (0)編輯 收藏

          MD5加密

               摘要:   閱讀全文

          posted @ 2009-04-07 10:54 luofeng225 閱讀(172) | 評論 (0)編輯 收藏

          使用J2SE API讀取Properties文件的六種方法

               摘要: 如題  閱讀全文

          posted @ 2009-04-07 10:16 luofeng225 閱讀(179) | 評論 (0)編輯 收藏

          Perl了解

               摘要:   閱讀全文

          posted @ 2009-04-06 14:45 luofeng225| 編輯 收藏

          InnoDB和MyISAM是在使用MySQL最常用的兩個表類型

               摘要: InnoDB和MyISAM是在使用MySQL最常用的兩個表類型  閱讀全文

          posted @ 2009-04-06 14:34 luofeng225| 編輯 收藏

          IO流大概

               摘要: java IO流基礎(chǔ)  閱讀全文

          posted @ 2009-04-01 00:00 luofeng225 閱讀(206) | 評論 (0)編輯 收藏

          UI,用戶界面User Interface的縮寫

               摘要:   閱讀全文

          posted @ 2009-03-30 23:09 luofeng225 閱讀(745) | 評論 (0)編輯 收藏

          getHibernateTemplate().getSessionFactory().getCurrentSession()

               摘要: 區(qū)別

          getHibernateTemplate().getSessionFactory().openSession()

          getHibernateTemplate().getSessionFactory().getCurrentSession()
            閱讀全文

          posted @ 2009-03-29 23:03 luofeng225 閱讀(2708) | 評論 (0)編輯 收藏

          Jbpm

               摘要: 簡單介紹,jBPM,全稱是Java Business Process Management,是一種基于J2EE的輕量級工作流管理系統(tǒng)。  閱讀全文

          posted @ 2009-03-29 17:38 luofeng225 閱讀(477) | 評論 (0)編輯 收藏

          云計算:分布式網(wǎng)絡(luò)服務(wù)可靠性分析

               摘要: 了解云計算  閱讀全文

          posted @ 2009-03-29 17:33 luofeng225 閱讀(301) | 評論 (0)編輯 收藏

          Spring一些基本概念

               摘要: Aop,Ioc,pointcut,。。  閱讀全文

          posted @ 2009-03-29 11:47 luofeng225 閱讀(205) | 評論 (0)編輯 收藏

          常用的UML圖

               摘要: 簡述最常用的UML圖:用例圖、類圖、序列圖、狀態(tài)圖、活動圖、組件圖和部署圖  閱讀全文

          posted @ 2009-03-29 02:00 luofeng225 閱讀(967) | 評論 (0)編輯 收藏

          VO ,PO ,BO,QO, DAO ,POJO,概念

               摘要:   閱讀全文

          posted @ 2009-03-28 16:07 luofeng225 閱讀(14019) | 評論 (1)編輯 收藏

          不定數(shù)組

           

          同一種類型的參數(shù),調(diào)用前又不知道是幾個?可以考慮定義有一個不定數(shù)組的函數(shù)(方法)。


          /**
           * 根據(jù)hql查詢,直接使用HibernateTemplate的find函數(shù).
           * @param values 可變參數(shù)
           */
           public List find(String hql, Object... values) {
            //Assert.hasText(hql);
            return getHibernateTemplate().find(hql, values);
           }

          posted @ 2009-03-28 14:34 luofeng225 閱讀(242) | 評論 (0)編輯 收藏

          group by,order by ,having

               摘要: 區(qū)別 group by,order by,having,where  閱讀全文

          posted @ 2009-03-28 14:26 luofeng225 閱讀(3573) | 評論 (0)編輯 收藏

          ==與equals的區(qū)別

               摘要: 徹底區(qū)別  閱讀全文

          posted @ 2009-03-28 14:24 luofeng225 閱讀(196) | 評論 (0)編輯 收藏

          switch case


          關(guān)于java中switch使用的一些說明
          switch(表達式)
          {
          case 常量表達式1:語句1;
          ....
          case 常量表達式2:語句2;
          default:語句;
          }

          default就是如果沒有符合的case就執(zhí)行它,default并不是必須的.
          case后的語句可以不用大括號.
          switch語句的判斷條件可以接受int,byte,char,short,不能接受其他類型.
          一旦case匹配,就會順序執(zhí)行后面的程序代碼,而不管后面的case是否匹配,直到遇見break,利用這一特性可以讓好幾個case執(zhí)

          行統(tǒng)一語句.例如:switch(x){case 1:case 2:case3: System.out.println("haha");                break;case4:

          System.out.println("hehe");}

          posted @ 2009-03-28 14:22 luofeng225 閱讀(164) | 評論 (0)編輯 收藏

          最常用的選擇器

               摘要: 標簽選擇器,id選擇器,類選擇器,群組選擇器,派生選擇器  閱讀全文

          posted @ 2009-03-28 14:17 luofeng225 閱讀(136) | 評論 (0)編輯 收藏

          Css 優(yōu)先級

          關(guān)鍵字: css selector

          CSS樣式定義多了,常常出現(xiàn)顯示效果與預(yù)期不一致的情況。其中很大一部分原因在于起作用的樣式。

          1.多個選擇器可能會選擇同一個元素,有3個規(guī)則,從上到下重要性降低:
                !important的用戶樣式
                !important的作者樣式
                作者樣式
                用戶樣式
                瀏覽器定義的樣式

          2.
          CSS規(guī)范為不同類型的選擇器定義了特殊性權(quán)重,特殊性權(quán)重越高,樣式會被優(yōu)先應(yīng)用。
          權(quán)重設(shè)定如下:
          html選擇器,權(quán)重為1;
          類選擇器,權(quán)重為10;
          id選擇器,權(quán)重為100;
          這里還有一種情況:在html標簽中直接使用style屬性,這里的style屬性的權(quán)重為1000;
          即如下情況:
          #x34y {color:red}
          <.  p id=x34y style="color:green">  優(yōu)先選擇style=""設(shè)定的樣式。

          例子:
          h1{color:blue}  權(quán)重為1
          p  em{color:yellow}  權(quán)重為2
          .warning{color:red}  權(quán)重為10
          p.note em.dark{color:grag}  權(quán)重為22
          #main{color:black}  權(quán)重為100     這里還有一種情況:
          權(quán)重一樣時如何處理?

          3.CSS樣式的層疊原則——誰離我近,誰說了算。
          當權(quán)重一樣時,會采用“層疊原則” 后定義的會被應(yīng)用。
          如:p{color:yellow}
                  p{color:red}
          作用到這里   <. p >我的什么顏色呢?< /p>
          結(jié)果會是red的。


          4.CSS樣式的特殊標記——誰有特權(quán),誰說了算。
          如果有人看不順眼,非得要自己說了算,那可以搞點特權(quán),如下即可
          p {color:blue !important;}
          加上!important;可將自己權(quán)重設(shè)為最高。
          http://zjq-blog.javaeye.com/blog/159469

          posted @ 2009-03-28 14:13 luofeng225 閱讀(181) | 評論 (0)編輯 收藏

          js中innerHTML與innerText的用法與區(qū)別

          用法:

          <div id="test">
             <span style="color:red">test1</span> test2
          </div>

          在JS中可以使用:

          test.innerHTML:

            也就是從對象的起始位置到終止位置的全部內(nèi)容,包括Html標簽。

            上例中的test.innerHTML的值也就是“<span style="color:red">test1</span> test2 ”。

          test.innerText: 

            從起始位置到終止位置的內(nèi)容, 但它去除Html標簽 

            上例中的text.innerTest的值也就是“test1 test2”, 其中span標簽去除了。

          test.outerHTML:

            除了包含innerHTML的全部內(nèi)容外, 還包含對象標簽本身。

            上例中的text.outerHTML的值也就是<div id="test"><span style="color:red">test1</span> test2</div>


          完整示例:

          <div id="test">
             <span style="color:red">test1</span> test2
          </div>

          <a href="javascript:alert(test.innerHTML)">innerHTML內(nèi)容</a>
          <a href="javascript:alert(test.innerText)">inerHTML內(nèi)容</a>
          <a href="javascript:alert(test.outerHTML)">outerHTML內(nèi)容</a>

          特別說明:

            innerHTML是符合W3C標準的屬性,而innerText只適用于IE瀏覽器,因此,盡可能地去使用innerHTML,而少用innerText,如果要輸出不含HTML標簽的內(nèi)容,可以使用innerHTML取得包含HTML標簽的內(nèi)容后,再用正則表達式去除

           

           

          HTML標簽,下面是一個簡單的符合W3C標準的示例:

          <a href="javascript:alert(document.getElementById('test').innerHTML.replace(/<.+?>/gim,''))">無HTML,符合W3C標準</a>

          posted @ 2009-03-28 14:09 luofeng225 閱讀(8443) | 評論 (4)編輯 收藏

          Struts2 iterator標簽集合中元素為數(shù)組的顯示

           

        1. <s:iterator value="collection1" status="status">  
        2.     <s:property value="collection1[#status.index][0]"/>  
        3.     <s:property value="collection1[#status.index][1]"/>  
        4. </s:iterator>  
        5.  

           

          說明:[#status.index][?]" ,指示遍歷數(shù)組指定的腳標元素,

          如果你不知道數(shù)組的長度呢?
          //以下是遍歷數(shù)組每一個元素
          <s:iterator value="total" status="stuts">
               
                 <s:iterator value="total[#stuts.index]" >
                           <s:property/><br>    
                 </s:iterator>
                
          </s:iterator>
          http://windring.javaeye.com/blog/108170

          posted @ 2009-03-28 14:08 luofeng225 閱讀(2308) | 評論 (1)編輯 收藏

          absolute與relative

          作者小毅的博客:http://andymao.com/ 

          很多朋友問過我absolute與relative怎么區(qū)分,怎么用?我們都知道absolute是絕對定位,relative是相對定位,但是這個絕對與相對是什么意思呢?絕對是什么地方的絕對,相對又是相對于什么地方而言的呢?那他們又有什么樣的特性,可以做出什么樣的效果呢?關(guān)于兩者之間又有什么樣的技巧呢?下面我們就來一一解讀。

           

           

          Absolute,CSS中的寫法是:position:absolute; 他的意思是絕對定位,他是參照瀏覽器的左上角,配合TOP、RIGHT、BOTTOM、LEFT(下面簡稱TRBL)進行定位,在沒有設(shè)定TRBL,默認依據(jù)父級的做標原始點為原始點。如果設(shè)定TRBL并且父級沒有設(shè)定position屬性,那么當前的absolute則以瀏覽器左上角為原始點進行定位,位置將由TRBL決定。

          一般來講,網(wǎng)頁居中的話用Absolute就容易出錯,因為網(wǎng)頁一直是隨著分辨率的大小自動適應(yīng)的,而Absolute則會以瀏覽器的左上角為原始點,不會應(yīng)為分辨率的變化而變化位置。很多人出錯就在于這點上出錯。而網(wǎng)頁居左其特性與Relative很相似,但是還是有本質(zhì)的區(qū)別的。

           

           

          Relative,CSS中的寫法是:position:relative;  他的意思是相對定位,他是參照父級的原始點為原始點,無父級則以BODY的原始點為原始點,配合TRBL進行定位,當父級內(nèi)有padding等CSS屬性時,當前級的原始點則參照父級內(nèi)容區(qū)的原始點進行定位。

          有時我們還需要依靠z-index來設(shè)定容器的上下關(guān)系,數(shù)值越大越在最上面,數(shù)值范圍是自然數(shù)。當然有一點要注意,父子關(guān)系是無法用z-index來設(shè)定上下關(guān)系的,一定是子級在上父級在下。

          http://www.blueidea.com/tech/web/2006/4249.asp

          posted @ 2009-03-28 14:04 luofeng225 閱讀(153) | 評論 (0)編輯 收藏

          SQL重復(fù)記錄查詢

           

          SQL重復(fù)記錄查詢


          1、查找表中多余的重復(fù)記錄,重復(fù)記錄是根據(jù)單個字段(peopleId)來判斷
          select * from people
          where peopleId in (select   peopleId from   people group by   peopleId having count (peopleId) > 1)

          2、刪除表中多余的重復(fù)記錄,重復(fù)記錄是根據(jù)單個字段(peopleId)來判斷,只留有rowid最小的記錄
          delete from people
          where peopleId in (select   peopleId from people group by   peopleId   having count (peopleId) > 1)
          and rowid not in (select min(rowid) from   people group by peopleId having count(peopleId )>1)

          3、查找表中多余的重復(fù)記錄(多個字段)
          select * from vitae a
          where (a.peopleId,a.seq) in   (select peopleId,seq from vitae group by peopleId,seq having

          count(*) > 1)

          4、刪除表中多余的重復(fù)記錄(多個字段),只留有rowid最小的記錄
          delete from vitae a
          where (a.peopleId,a.seq) in   (select peopleId,seq from vitae group by peopleId,seq having count(*) > 1)
          and rowid not in (select min(rowid) from vitae group by peopleId,seq having count(*)>1)

          5、查找表中多余的重復(fù)記錄(多個字段),不包含rowid最小的記錄
          select * from vitae a
          where (a.peopleId,a.seq) in   (select peopleId,seq from vitae group by peopleId,seq having

          count(*) > 1)
          and rowid not in (select min(rowid) from vitae group by peopleId,seq having count(*)>1)

          (二)
          比方說
          在A表中存在一個字段“name”,
          而且不同記錄之間的“name”值有可能會相同,
          現(xiàn)在就是需要查詢出在該表中的各記錄之間,“name”值存在重復(fù)的項;
          Select Name,Count(*) From A Group By Name Having Count(*) > 1
          如果還查性別也相同大則如下:
          Select Name,sex,Count(*) From A Group By Name,sex Having Count(*) > 1

          (三)
          方法一
          declare @max integer,@id integer
          declare cur_rows cursor local for select
          主字段,count(*) from 表名 group by 主字段 having

          count(*) >; 1
          open cur_rows
          fetch cur_rows into @id,@max
          while @@fetch_status=0
          begin
          select @max = @max -1
          set rowcount @max
          delete from 表名 where 主字段 = @id
          fetch cur_rows into @id,@max
          end
          close cur_rows
          set rowcount 0

          方法二

          有兩個意義上的重復(fù)記錄,一是完全重復(fù)的記錄,也即所有字段均重復(fù)的記錄,

          二是部分關(guān)鍵字段重復(fù)的記錄,比如Name字段重復(fù),而其他字段不一定重復(fù)或都重復(fù)可以忽略。

            1、對于第一種重復(fù),比較容易解決,使用
          select distinct * from tableName

            就可以得到無重復(fù)記錄的結(jié)果集。

            如果該表需要刪除重復(fù)的記錄(重復(fù)記錄保留1條),可以按以下方法刪除
          select distinct * into #Tmp from tableName
          drop table tableName
          select * into tableName from #Tmp
          drop table #Tmp

            發(fā)生這種重復(fù)的原因是表設(shè)計不周產(chǎn)生的,增加唯一索引列即可解決。

            2、這類重復(fù)問題通常要求保留重復(fù)記錄中的第一條記錄,操作方法如下

            假設(shè)有重復(fù)的字段為Name,Address,要求得到這兩個字段唯一的結(jié)果集
          select identity(int,1,1) as autoID, * into #Tmp from tableName
          select min(autoID) as autoID into #Tmp2 from #Tmp group by Name,autoID
          select * from #Tmp where autoID in(select autoID from #tmp2)

            最后一個select即得到了Name,Address不重復(fù)的結(jié)果集(但多了一個autoID字段,實際寫時可以寫

          在select子句中省去此列)

          (四)查詢重復(fù)
          select * from tablename

          where id in (select id from tablename group by id having count(id) > 1)

                                                                      --from 網(wǎng)絡(luò)

          http://hi.baidu.com/zeronet/blog/item/27c41046d2c0060a6b63e596.html

          posted @ 2009-03-28 13:03 luofeng225 閱讀(1431) | 評論 (0)編輯 收藏

          <2009年3月>
          22232425262728
          1234567
          891011121314
          15161718192021
          22232425262728
          2930311234

          導(dǎo)航

          統(tǒng)計

          公告

          我曾經(jīng)聽到這么一個故事: 一個年輕的程序員問一個老程序員(一個比較牛逼的公司的CTO) 年輕程序員: 你為什么這么牛X., 就好像沒有你不會的。老程序員: 積累的。年輕程序員: 怎么才能積累到您的程度呢。我每天都在積累。但是似乎都沒有感覺到進步。老程序員: 我從20歲開始做到了一件事情,直到今天,而且盡可能地保證不間斷。年輕程序員: 到底是什么? 老程序員: 我每天保證自己有2個小時在學(xué)習(xí)新的東西。

          常用鏈接

          留言簿(3)

          隨筆分類

          隨筆檔案

          文章分類

          相冊

          收藏夾

          Java Website

          java技術(shù)博客

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 辉县市| 蓬莱市| 龙川县| 新和县| 泽库县| 永兴县| 东莞市| 农安县| 武夷山市| 葵青区| 军事| 临西县| 乐陵市| 鹿邑县| 保定市| 达州市| 苏尼特左旗| 安康市| 登封市| 聂拉木县| 东城区| 苍山县| 和平区| 黄山市| 安国市| 友谊县| 城固县| 平顺县| 祁门县| 芜湖市| 闸北区| 岳阳市| 泌阳县| 辰溪县| 阜南县| 扶余县| 金平| 庆城县| 唐河县| 泸溪县| 孙吴县|