Results 1 to 2 of 2

Thread: query

  1. #1
    Join Date
    Jan 2004
    Location
    UK
    Posts
    21

    Unanswered: query

    I have a table tha hold points of the user. a user may have many points.
    How would I select a sum of all the users. I tried
    select sum(user_points) where table1.user_id in table2.user_id;
    and I have tried other thing as well but I just can't get it right.

    Thanks for your help

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    To get the total points per user:

    select user_id, sum(user_points)
    from table1
    group by user_id;

    To get the total for all users is just:

    select sum(user_points)
    from table1;

Posting Permissions

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