日期:2014-05-16 浏览次数:20461 次
DELETE A FROM Book AS a WHERE EXISTS(SELECT 1 FROM Book WHERE ISBN=a.ISBN AND a.Title=b.BookName AND ISNULL(PrimaryAuthor,'')>'') AND ISNULL(PrimaryAuthor,'')=''
DELETE a FROM [Table] a WHERE EXISTS(SELECT 1 FROM [Table] WHERE ISBN=a.ISBN AND PrimaryAuthor<>'') AND PrimaryAuthor=''
select *
from
(
select *,
ROW_NUMBER() over(partition by isbn order by primaryAuthor desc) rownum
from 表
)t
where rownum = 1