How to calculate the percentage of word using SQL Query? : Actual case is to read the total count difference in percentage basis. Since hello comes in first word its count-'1' but in the 3rd rows Hello count -2. Now i need to calculate the percentage of the word usage like previously it is 1, now it is 2 percentage is 50% increased. so i have to calculate percentage for particular word from previous and current.

    No, Text, Word, Totalcount
    1, Hello Welcome,Hello,1
    2, Hello Text, Text,1
    3, Hello Text! Hello, Hello,2

I have formed the following SQL query to calculate the percentage but it leads error.

    select Totalcount * 100/SUM(TotalCount) from table where Word = 'Hello'

it leads following issue .

    Word is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

Am googling but not found the better solution for it.

Suggest me the way the sql querying to do this. Any help appreciated.


