DECLARE @User int SELECT @user = 23199 select top 25 tag...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Psychology and Neuroscience

Q&A for practitioners, researchers, and students in cognitive science, psychology, neuroscience, and psychiatry

              DECLARE @User int
SELECT @user = 23199

select top 25 tagname   , count(*)             
from posts as p                   
inner join posttags as pt on pt.postid = p.id         
inner join tags as t on t.id = pt.tagid              
where (p.owneruserid = @user and p.posttypeid = 1)
OR P.ID IN (
             SELECT ParentID 
             FROM Posts 
             WHERE p.posttypeid = 2 
             AND p.owneruserid = @user  
             )
group by tagname
order by 2 desc
 
--select * from posts where owneruserid = 23199

Enter Parameters

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