Please login or register to vote for this query.

(click on this box to dismiss)


Q&A for Joomla! administrators, users, developers and designers

select p.id as [Post Link]
     , min(score) score
     , sum(case when votetypeid = 2 then 1 else 0 end) as up
     , sum(case when votetypeid = 3 then 1 else 0 end) as down
from posts p
inner join votes v on v.postid = p.id 
where p.id = 10958092
and posttypeid = 2 -- answers
and v.votetypeid in (2,3)
group by p.id
order by score , 3,4

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results