日期:2014-05-17 浏览次数:20645 次
delete ceshi
where BOOK_BARCO in
(select BOOK_BARCO
from (select *,rn=row_number() over(partition by TITLE,BOOK_SEARC order by BOOK_BARCO) from tb)t
where rn>1
)
DELETE ceshi
WHERE EXISTS ( SELECT 1
FROM ( SELECT TITLE ,
BOOK_SEARC
FROM ceshi
GROUP BY TITLE ,
BOOK_SEARC
HAVING COUNT(*) > 1
) b
WHERE ceshi.title = b.title
AND ceshi.book_searc = b.book_searc )
with t
as
(
select *,
row_number() over(paritition by TITLE,BOOK_SEARC