User-specific gendered comment count

4

Please login or register to vote for this query.

(click on this box to dismiss)

Language Learning

Q&A for students, teachers, polyglots, and anyone interested in the techniques of second-language acquisition

SELECT 
  c.Id, c.Text, c.CreationDate
INTO #coms
FROM Comments c 
WHERE
  c.UserId = ##UserId##
  

DECLARE @gendered_comments AS Int
DECLARE @total_comments AS Int

SELECT @total_comments = COUNT(*) FROM #coms
SELECT c.Id AS [Comment Link], c.CreationDate FROM #coms c
WHERE 
   c.Text LIKE '%[^a-zA-Z0-9][Hh]e[^a-zA-Z0-9]%' OR
   c.Text LIKE '%[^a-zA-Z0-9][Hh]im[^a-zA-Z0-9]%' OR
   c.Text LIKE '%[^a-zA-Z0-9][Hh]is[^a-zA-Z0-9]%' OR
   c.Text LIKE '%[^a-zA-Z0-9][Ss]he[^a-zA-Z0-9]%' OR
   c.Text LIKE '%[^a-zA-Z0-9][Hh]er[^a-zA-Z0-9]%'
ORDER BY c.CreationDate ASC

Enter Parameters

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