SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 28 of 28
  1. #26
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,336
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Code:
    SELECT team.teamName
         , SUM(activity.activityValue) AS some_total    
      FROM team
    INNER
      JOIN entry
        ON entry.teamID = team.teamID
    INNER
      JOIN activity
        ON activity.ID = entry.activityID
    GROUP 
        BY team.teamName
    ORDER 
        BY some_total DESC LIMIT 3
    you need to learn about joins, yes?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  2. #27
    SitePoint Guru
    Join Date
    Jul 2003
    Location
    england
    Posts
    823
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Smile

    It's shows...doesn't it. How sad is that.

    I just appreciate the time the Sitepoint's experts take to help people like me. I don't expect complete answers--I expect to struggle, but then there's the point of frustration where I cannot concentrate and understand ANY of what I'm doing to make what I want work right.

    I've been coming to Sitepoint for years. Whenever I can't find an answer, I try to understand posts similar to what I want to do and learn from that--which is great! There's so much more to learn that it amazes me how much enthusiasts such as yourself know and I appreciate you guys the more!

    I'll try the join you recommended and post back. Knowing your knowledge, no doubt it will work great!

    Thank you for your time and I'll get back to you!

  3. #28
    SitePoint Guru
    Join Date
    Jul 2003
    Location
    england
    Posts
    823
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Smile

    r937,

    Thank you for your help. This worked like a charm.

    I'm sure learning about JOINs are not at all hard. When it comes to standard JOINs, I'm okay. When I start reading about LEFT JOINs and RIGHT JOINs, that's where things get a little confusing; but I do plan on reading more about it.

    Thank you again for your help!
    toad78


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
  •