Q R tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Amateur Radio

Q&A for amateur radio enthusiasts

WITH History (LastActivityDate, PostTypeId, Tags, Tags2 , PostId, UserId)  
AS  
-- Define the CTE query.  
(  
SELECT
TOP 5000

p.LastActivityDate, 
p.PostTypeId, 
p.Tags  ,parent.Tags,

  p.Id AS [Post Link],
  p.OwnerUserId as [User Link]
  FROM dbo.Posts p
  LEFT OUTER JOIN dbo.Posts parent
      ON p.ParentId = parent.Id
  LEFT OUTER JOIN dbo.PostTags pt
    ON p.Id = pt.PostId
  LEFT OUTER JOIN dbo.Tags t
    ON t.Id = pt.TagId
  INNER JOIN Users U ON U.Id=p.OwnerUserId
--  WHERE t.TagName = ##tag:string##
  AND LOWER(U.Location) LIKE LOWER('%bucharest%')
  GROUP BY p.LastActivityDate, parent.Tags, p.Tags,
  p.PostTypeId, 
  p.Id,
  p.OwnerUserId
  ORDER BY p.LastActivityDate DESC
)


SELECT LastActivityDate,  IIF(PostTypeId > 1, 'A', 'Q') AS [POST TYPE], CONCAT (Tags,  Tags2) AS [Tags], PostId AS [Post Link], UserId as [User Link]
FROM History
WHERE LOWER(CONCAT (Tags,  Tags2)) LIKE LOWER('%##tag##%')
ORDER BY LastActivityDate DESC

Enter Parameters

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