all posts for users

0

Please login or register to vote for this query.

(click on this box to dismiss)

Joomla Meta

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

select u.id [User Link]
     , u.reputation
     , u.creationdate
     , count(*) [# posts]
     , sum(case when posttypeid = 1 then 1 else null end) [# Questions]
     , sum(case when posttypeid = 2 then 1 else null end) [# Answers]
     , sum(case when posttypeid = 4 then 1 else null end) [# Excerpts]
     , sum(case when posttypeid = 5 then 1 else null end) [# Wiki]
from users u
inner join posts p on p.owneruserid = u.id
where posttypeid in (1,2,4,5)
group by u.id
       , u.reputation
     , u.creationdate
order by [# posts] desc

Enter Parameters

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