朱杰兵blog

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

          sql

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

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


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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 东至县| 利辛县| 沙洋县| 富平县| 阳曲县| 罗平县| 沙田区| 应城市| 陆丰市| 定安县| 井研县| 镇原县| 竹北市| 若尔盖县| 东乡| 临漳县| 阿巴嘎旗| 汽车| 忻城县| 仙桃市| 永吉县| 二手房| 武冈市| 福州市| 石楼县| 康马县| 宿松县| 乐至县| 普兰店市| 苗栗县| 奉贤区| 武宣县| 玉龙| 永康市| 钟祥市| 石渠县| 澎湖县| 乌拉特后旗| 武汉市| 日喀则市| 张掖市|