Created
June 27, 2013 19:24
-
-
Save hudo/5879552 to your computer and use it in GitHub Desktop.
count duplicated titles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update rp | |
set rp.TitleDuplicateCount = rj.tcount | |
from ReportPages rp | |
inner join | |
( | |
select count(rp2.TitleHash) as tcount, rp2.TitleHash | |
from ReportPages rp2 | |
where rp2.ProjectId = {0} and PageType = 1 and HasTitle = 1 | |
group by rp2.TitleHash | |
having COUNT(rp2.titleHash) > 1 | |
) rj on rp.TitleHash = rj.TitleHash | |
where rp.ProjectId = {0} and PageType = 1 and HasTitle = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment