Count of "Thank You" comments

0

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

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

Enter Parameters

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