Skip to content

Instantly share code, notes, and snippets.

@Noitidart
Last active May 20, 2020 01:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Noitidart/27bb64bdfcc00645a12c78c8c4f6c676 to your computer and use it in GitHub Desktop.
Save Noitidart/27bb64bdfcc00645a12c78c8c4f6c676 to your computer and use it in GitHub Desktop.
Search for comments by tag of post
// https://data.stackexchange.com/stackoverflow/query/1027054/search-posts-by-userid-comment-text?CommentText=ios&TagName=react-native
SELECT Posts.Id AS [Post Link], Comments.Text, Comments.CreationDate
FROM Comments
LEFT JOIN Posts ON Posts.Id = Comments.PostId
WHERE UPPER(Comments.Text) LIKE UPPER('%##CommentText##%')
AND Comments.UserId = '1828637'
AND Posts.Tags LIKE '%<##TagName##>%'
ORDER BY Comments.CreationDate DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment