Preguntas y respuestas para programadores y profesionales de la informática
select top 500 PostId [Post Link], sum( case when VoteTypeId=2 then 1 else -1 end) Puntaje, count(case when VoteTypeId=2 then 1 else null end) Positivos, count(case when VoteTypeId=3 then 1 else null end) Negativos, count(*) Total from PostFeedback left join PostsWithDeleted on PostFeedback.PostId = PostsWithDeleted.Id group by PostId order by Total desc, Puntaje desc, Positivos desc, PostId desc