Count of "Thank You" comments


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

declare @thankYouCount float;
declare @commentCount float;

select @thankYouCount = count(1)
from Comments c
where len(c.Text) < 25
and (c.Text like '%thank you%' or c.Text like '%thanks%')

select @commentCount = count(1)
from Comments

  @thankYouCount [total thanks comments],
  @commentCount [total comments],
  (@thankYouCount / @commentCount) * 100 [percent]

Enter Parameters

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