select (select count(*) from votes v1 where v1.postid=p.i...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Ubuntu

Q&A for Ubuntu users and developers

select 
(select count(*) from votes v1
where v1.postid=p.id and v1.votetypeid=2) as upvotes,
(select count(*) from votes v2
where v2.postid=p.id and v2.votetypeid=3) as downvotes,
(select count(*) from votes v3
where v3.postid=p.id and v3.votetypeid=1) as isAccepted
from posts p 
where owneruserid=22656

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results