answers that should have votes

2

Please login or register to vote for this query.

(click on this box to dismiss)

answers by specified user(s) that "should" have votes

Moderators

Q&A for community managers, administrators, and moderators

select 
  RANK ( ) OVER ( partition by a.owneruserid 
  ORDER BY case when a.acceptedanswerid is null then 0 else 1 end desc,len(a.body) desc ) as rnk,
  a.owneruserid as [User Link],
  a.id as [Post Link],
  a.acceptedanswerid,
  case when a.acceptedanswerid is null then 0 else 1 end as accepted, 
  format(a.creationdate,'yyyy-MM-dd') as answered,
  len(a.body) as length,
  q.ViewCount as Views
into #tmp
from posts a left join posts q on q.id=a.parentid
where a.posttypeid=2
and a.owneruserid in ( ##UserID## )
and a.score <=0
order by  a.acceptedanswerid desc ,
  len(a.body) desc;
  
select * from #tmp where rnk <= 21
order by rnk, views desc, [User Link]

--UserID: Enter one or more (comma separated) numeric UserID's:

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results