Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009
    Posts
    47

    Unanswered: counting items in Access SQL

    hi,
    can anyone help me with counters in Access SQL..
    I have a data table and i want to count how many times a certain record appears. example

    Column 1 (Index)
    1234
    4321
    5643
    1234
    4321
    1234

    so the output should be

    column (index)------count
    1234----------------3
    4321----------------2
    5643----------------1

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    SELECT daColumn
         , COUNT(*) AS [count]
      FROM daTable
    GROUP
        BY daColumn
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Feb 2009
    Posts
    47

    worked out great

    thanks for he help it worked out just asi wanted it. I have a similar problem
    i was trying to run the code on a counter where it has to look at different rows and increment a counter based on that i'll post an example later .
    thanks again

Posting Permissions

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