It is amazing to realize what a large percentage of total posts on SQLTeam that a very small number of people have made.The top 3 posters have made over 11% of all posts, the top 10 have made over 25% of all posts, and the top 20 have made over 34% of all posts. set nocount ondeclare @a table (Name varchar(30) , Posts int, Seq int identity(1,1) )insert into @aselect Name = 'tkizer',Posts =14566 Union allselect 'robvolk',10967 Union allselect 'nr',10525 Union allselect 'Kristen',9216 Union allselect 'X002548',9023 Union allselect 'madhivanan',7983 Union allselect 'spirit1',5831 Union allselect 'jsmith8858',5229 Union allselect 'Merkin',4770 Union allselect 'derrickleggett',4148 Union allselect 'khtan',3603 Union allselect 'jen',3440 Union allselect 'SamC',3412 Union allselect 'graz',3128 Union allselect 'AjarnMark',3107 Union allselect 'rockmoose',2894 Union allselect 'Michael Valentine Jones',2799 Union allselect 'eyechart',2681 Union allselect 'Page47',2571 Union allselect 'MichaelP',2423print 'Percentage of posts on SQLTeam'print ''select [Top 1] = convert(decimal(7,2),round( (100.*sum(case when seq <2 then Posts else 0 end))/324826. ,2)) , [Top 3] = convert(decimal(7,2),round( (100.*sum(case when seq <4 then Posts else 0 end))/324826. ,2)) , [Top 5] = convert(decimal(7,2),round( (100.*sum(case when seq <6 then Posts else 0 end))/324826. ,2)) , [Top 10] = convert(decimal(7,2),round( (100.*sum(case when seq <11 then Posts else 0 end))/324826. ,2)) , [Top 20] = convert(decimal(7,2),round( (100.*sum(case when seq <21 then Posts else 0 end))/324826. ,2))from @a
Results:Percentage of posts on SQLTeam Top 1 Top 3 Top 5 Top 10 Top 20 --------- --------- --------- --------- --------- 4.48 11.10 16.72 25.32 34.58
CODO ERGO SUM