--查询重复章节
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;
--查询重复小说
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;