SELECT TOP 200 Id as [Post Link], Score, ViewCount, Tags,...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Cognitive Sciences Meta

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

SELECT TOP 200 Id as [Post Link], Score, ViewCount, Tags, Body
FROM Posts 
WHERE Tags LIKE CONCAT('%<', '##TAGNAME1##', '>%')
  
ORDER BY ViewCount DESC



/*
and Tags LIKE CONCAT('%<', '##TAGNAME2##', '>%')
and Tags LIKE CONCAT('%<', '##TAGNAME3##', '>%')


select top 10 PostId AS [Post Link], TagId, count(TagId)
from PostTags 
where TagId = (1,2,3,4,5,6,7,8,9,0)
group by PostId, TagId


declare @TagString1 nvarchar(25) = ##tagName1:string##
declare @TagString2 nvarchar(25) = ##tagName2:string##
declare @TagString3 nvarchar(25) = ##tagName3:string##


select TOP ##ResultSize## ViewCount, Score,Tags, Id AS [Post Link]
from Posts 


where Id in
  (
    select PostId 
    from PostTags 
    where TagId IN (
    (
      select Id 
      from Tags 
      where TagName IN (@TagString1,@TagString2,@TagString3)
      ))
  )
ORDER by ViewCount DESC
*/

Enter Parameters

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