Questions with any of the tags in the title or body

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS

Q&A for administrators, end users, developers and designers for Craft CMS

SELECT TOP 10 p.Id AS [Post Link], p.Tags
  FROM Posts AS p
  INNER JOIN PostTags AS pt
    ON p.Id = pt.PostId
  INNER JOIN Tags AS t
    ON t.Id = pt.TagId
  WHERE ' ' + p.Title + ' ' LIKE ' %' + t.TagName + ' %'
     OR ' ' + p.Body + ' ' LIKE ' %' + t.TagName + ' %'

Enter Parameters

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