select Closevotes, count(*) from ( select (select count(*...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Programmers

Q&A for expert programmers interested in professional discussions on software development

select Closevotes, count(*)
from
(
    select (select count(*) from votes where postid = posts.id and votetypeid = 6) as [CloseVotes], *
    from posts 
    where posttypeid = 1 and not closeddate is null
) as t
group by Closevotes
order by closevotes

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached