count repeating words and total

Posted on 2006-04-07
Last Modified: 2012-05-05
I have a table with a single column that is used to collect search words.
What I want to do is total up the number of times each word appears, ex:
I want to make a list of the words with a count of how many like this:
avator  3
anator  1
shaker  2
gamma 3

can I do this with sql or should I do this in code?  thanks

Question by:MikeMCSD
    LVL 14

    Assisted Solution

    Select Word, COUNT(*) as [Count of Word]
    FROM MyTable
    group by Word
    LVL 75

    Accepted Solution

    SELECT Distinct Word, COUNT(*) as [Count]
    FROM urTable
    GROUP BY Word
    LVL 16

    Author Comment

    perfect, thanks guys

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    I recently came across an interesting Question In EE ( and was puzzled about how to achieve that using SSIS out of the box tasks, which was i…
    Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now