SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict AbelaJohnB's Avatar
    Join Date
    Oct 2001
    Location
    Eureka, CA. USA
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SQL Count Method... Need Help

    Hello.

    I have a table with a field called: ViewTimes


    The table has 200+ rows.


    I want to count the -total- 'ViewTimes' for -all- 200+ rows.


    So, if

    ID 1 has 10 views
    ID 2 has 2 views
    ID 3 has 5 view


    It would return: 17



    *I remember asking this before... but I can't find my old post *
    John B. Abela
    www.JohnAbela.Com

  2. #2
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    SELECT SUM(ViewTimes) AS total FROM table
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  3. #3
    SitePoint Addict AbelaJohnB's Avatar
    Join Date
    Oct 2001
    Location
    Eureka, CA. USA
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oye, thanks Matt!!





    *bangs his head against his moniter*
    John B. Abela
    www.JohnAbela.Com


Bookmarks

Posting Permissions

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