1

0

Please login or register to vote for this query.

(click on this box to dismiss)

Amateur Radio

Q&A for amateur radio enthusiasts

select 
  u.Reputation
  ,u.CreationDate
  ,u.Views
  ,u.UpVotes
  ,u.DownVotes
  ,Comments = count(c.Id)
  ,Posts = COUNT(p.AcceptedAnswerId)
  /*,Answers = ( 
                  SELECT p.AnswerCount
                  FROM Posts p
                  WHERE p.OwnerUserId = u.Id)*/
  /*,Badges = STUFF((
                    select ' | ', b.Name
                    from Badges b
                    where b.UserId = u.Id and TagBased = 0
                    for XML PATH(''), Type).value('.', 'NVARCHAR(MAX)'), 1, 1, '')*/
                    
from Users u
left join Comments c ON c.UserId = u.Id
INNER JOIN Posts p ON p.OwnerUserId = u.Id
--JOIN Posts p ON p.Id = u.Id
where DisplayName = 'scsimon'
group by
   u.Reputation
  ,u.CreationDate
  ,u.Views
  ,u.UpVotes
  ,u.DownVotes
  ,u.Id

Enter Parameters

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