Q&A for professional and enthusiast programmers
-- Number of comments thanking somebody declare @totalcomments int select @totalcomments = count(id) from comments select 'comments', count(Id) as [Count], count(Id) * 100.0 / @totalcomments as [Percentage] from comments where text like '%thank%';