Search code examples
c#windowswinformsms-accessoledb

How to count the same name inside a column?


This is my column showing the name of the president the user voted:

snapshot

I need to count these names in order to show the result of the election. How do I count it using select count() and group by?


Solution

  • The following SQL should do the trick.

    SELECT President, COUNT(*)
    FROM tbl_voter
    GROUP BY President