朱杰兵blog

          jonhney'blog
          posts - 140, comments - 1, trackbacks - 0, articles - 0

          sql

          Posted on 2015-03-12 13:53 朱杰兵 閱讀(91) 評論(0)  編輯  收藏
          兩張關聯(lián)表,刪除主表中已經(jīng)在副表中沒有的信息
          delete from table1 where not exists ( select * from table2 where table1.field1=table2.field1 )

          刪除重復記錄
          delete from tablename where id not in (select max(id) from tablename group by col1,col2,...)


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導航:
           
          主站蜘蛛池模板: 中方县| 微博| 伽师县| 安国市| 成安县| 天水市| 板桥市| 政和县| 嵩明县| 佳木斯市| 寻乌县| 金山区| 耒阳市| 安义县| 六安市| 孟连| 陇南市| 南澳县| 来宾市| 将乐县| 黄骅市| 秦安县| 佛冈县| 万源市| 襄樊市| 左权县| 岑溪市| 阿拉善右旗| 宁强县| 仙桃市| 香港 | 朝阳区| 嵊州市| 洛扎县| 扎赉特旗| 巴塘县| 班戈县| 阜新| 辽宁省| 舞阳县| 台江县|