Results 1 to 2 of 2

Thread: sql query help

  1. #1

    Thread Starter
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 2005
    Posts
    930

    sql query help

    is it possible to run a count on a column and get the results of each diffrent type of data in the column


    I tried playing with count but htat just gives me the total for the column


    for example


    rob
    rob
    tim
    buddy
    rhaps
    dog
    dog


    query returns"
    rob =2
    tim=1
    rhaps=1
    bueey=1
    dog=2

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: sql query help

    SQL Code:
    1. SELECT Name, COUNT(Name)
    2. FROM MyTable
    3. GROUP BY Name
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width