精品久久久久久无码专区_久久精品国产99久久久古代_久久精品人妻无码一区二区三区_久久婷婷综合色丁香五月_老色鬼久久亚洲AV综合_两个人看的WWW在线观看_麻豆精产国品一二三产区区_最近中文字幕免费MV在线视频_影音先锋女人AA鲁色资源_男人扒开女人内裤强吻桶进去,国产精品自在拍首页,AV高潮娇喘抽搐喷水视频,日韩av片无码一区二区不卡电影

推廣 熱搜: 后臺(tái)  帝國(guó)cms  位置  網(wǎng)站  Wordpress教程  帝國(guó)cms建站  內(nèi)容  DESTOON  郵箱  destoon7.0 

易讀小說(shuō)拒絕重復(fù)采集的解決辦法

   日期:2019-09-23     瀏覽:199    違規(guī)舉報(bào)
 
騰訊云服務(wù)器優(yōu)惠

易讀小說(shuō)系統(tǒng)是一款開(kāi)源的JAVA小說(shuō)程序,,可以幫你快速搭建自己的小說(shuō)系統(tǒng),,但是往來(lái)自不同網(wǎng)站的數(shù)據(jù)會(huì)重復(fù),,如何解決數(shù)據(jù)重復(fù)的問(wèn)題,,有網(wǎng)友分享了以下的解決辦法,。

  1. ssh登陸服務(wù)器

  2. 執(zhí)行命令:

        su - postgres

        如果出現(xiàn)輸入密碼窗口,, 輸入postgres

        psql -U postgres -d 你的數(shù)據(jù)庫(kù)名

        create unique index unique_index_articleno_chaptername ON t_chapter(articleno,chaptername);
        create unique index unique_index_articlename_author ON t_article(articlename,author);


如果安裝過(guò)程是默認(rèn)的,, 你的數(shù)據(jù)庫(kù)名就是yidu,, 如果改了, 就到web目錄下進(jìn)入WEB-INF/classes,, 在jdbc.properties中找到數(shù)據(jù)庫(kù)名    jdbc.url=jdbc:postgresql://127.0.0.1:5432/你的數(shù)據(jù)庫(kù)名


添加兩個(gè)唯一索引之前必須確保數(shù)據(jù)庫(kù)中不存在重復(fù)章節(jié),、重復(fù)小說(shuō)


以下兩條sql分別查詢重復(fù)章節(jié)和重復(fù)小說(shuō)


--查詢重復(fù)章節(jié)
select articleno,chapterno from t_chapter where chapterno in (
    select max(chapterno) from t_chapter tc inner join (
        select articleno ,chaptername from t_chapter
        group by articleno,chaptername having count(1)>1
    ) tc1 on tc.chaptername = tc1.chaptername and tc.articleno = tc1.articleno
);

--查詢重復(fù)小說(shuō)
select articleno,articlename from t_article where articleno in (
    select max(articleno) from t_article tc inner join (
        select articlename from t_article
        group by articlename having count(1)>1
    ) tc1 on tc.articlename = tc1.articlename
);


查詢結(jié)果正確的話,, 將select xxxx from 修改為 delete from 重新執(zhí)行即可。



刪除重復(fù)章節(jié)
delete from t_chapter where chapterno in (
   select max(chapterno) from t_chapter tc inner join (
       select articleno ,chaptername from t_chapter
       group by articleno,chaptername having count(1)>1
   ) tc1 on tc.chaptername = tc1.chaptername and tc.articleno = tc1.articleno
);
刪除重復(fù)小說(shuō)
delete from t_article where articleno in (
   select max(articleno) from t_article tc inner join (
       select articlename from t_article
       group by articlename having count(1)>1
   ) tc1 on tc.articlename = tc1.articlename
);

刪除指定小說(shuō)全部章節(jié)

delete from t_chapter where articleno = 數(shù)字id;

--查詢重復(fù)章節(jié)

select * from (

    select tc.articleno,tc.chapterno,row_number() over(partition by tc.chaptername order by tc.chapterno asc) mark

    from t_chapter tc inner join (

        select articleno ,chaptername from t_chapter

        group by articleno,chaptername having count(1)>1

    ) tc1 on tc.chaptername = tc1.chaptername and tc.articleno = tc1.articleno

) temp where mark<>1;

--查詢重復(fù)小說(shuō)

select * from (

    select tc.articleno,tc.articlename,row_number() over(partition by tc.articlename order by articleno asc) mark 

    from t_article tc inner join (

           select articlename from t_article

           group by articlename having count(1)>1

      ) tc1 on tc.articlename = tc1.articlename

) temp where mark<>1;



免責(zé)聲明:
1,、本站所收集的部分公開(kāi)資料來(lái)源于互聯(lián)網(wǎng),,轉(zhuǎn)載的目的在于傳遞更多信息及用于網(wǎng)絡(luò)分享,并不代表本站贊同其觀點(diǎn)和對(duì)其真實(shí)性負(fù)責(zé),,也不構(gòu)成任何其他建議,。
2、本站部分作品內(nèi)容是由網(wǎng)友自主投稿和發(fā)布,、編輯整理上傳,,對(duì)此類內(nèi)容本站僅提供交流平臺(tái),不為其版權(quán)負(fù)責(zé),,更不為其觀點(diǎn)承擔(dān)任何責(zé)任,。
3、因行業(yè)及專業(yè)性有限,,故未能核驗(yàn)會(huì)員發(fā)布內(nèi)容的真實(shí)性及有效性,,不為其負(fù)責(zé),如有虛假或違規(guī)內(nèi)容敬請(qǐng)準(zhǔn)備材料圖片發(fā)郵件到info@n#舉報(bào),,本站核實(shí)后積極配合刪除,。
4、如果您發(fā)現(xiàn)網(wǎng)站上有侵犯您的知識(shí)產(chǎn)權(quán)的作品,,請(qǐng)與我們?nèi)〉寐?lián)系,,我們會(huì)及時(shí)處理或刪除。
 
打賞
 
更多>同類網(wǎng)站技術(shù)
0相關(guān)評(píng)論

推薦圖文
推薦網(wǎng)站技術(shù)
點(diǎn)擊排行
網(wǎng)站首頁(yè)  |  關(guān)于我們  |  聯(lián)系方式  |  使用協(xié)議  |  免責(zé)聲明  |  版權(quán)隱私  |  信息發(fā)布規(guī)則  |  網(wǎng)站地圖  |  排名推廣  |  廣告服務(wù)  |  積分換禮  |  網(wǎng)站留言  |  RSS訂閱  |  違規(guī)舉報(bào)  |  粵ICP備2020081222號(hào)
Powered By DESTOON