You better show me some fucking gratitude after I did your homework for free

0

Please login or register to vote for this query.

(click on this box to dismiss)

Wholesome comments to me (no mean comments)

Craft CMS Meta

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

declare @userID int = ##UserID?9449426##
declare @userName nvarchar(max)

-- Find and get the user name based on user ID
SELECT TOP 1 @userName = DisplayName
FROM Users
WHERE Id = @userId

-- Find all answers from this user
SELECT *
INTO #myPosts
FROM Posts
WHERE OwnerUserId = @userID
  AND PostTypeId = 2
  AND CommentCount > 0
  AND DeletionDate IS NULL


-- Find all comments of this user posts. Filter by
-- comment text takes too long otherwise
SELECT c.Text AS Comment,
       c.Id AS [Comment Link],
       c.UserId AS [User Link],
       p.Id AS [Post Link]
FROM Comments c
JOIN #myPosts p ON p.Id = c.PostId
WHERE c.UserId != @userId
 AND (LOWER(Text) LIKE '%thanks%'
   OR LOWER(Text) LIKE '%thank you%'
   OR LOWER(Text) LIKE '%thnx%'
   OR LOWER(Text) LIKE '%thx%'
   OR LOWER(Text) LIKE '%wow%'
   OR LOWER(Text) LIKE '%mvp%'
   OR LOWER(Text) LIKE '%made my day%'
   OR LOWER(Text) LIKE '%savage%')

Enter Parameters

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