Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6352319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:10:47+00:00 2026-05-24T22:10:47+00:00

user table user_id entry user_id points_a points_b SELECT user.*, (SUM(entry.points_a) + SUM(entry.points_b)) as points_total

  • 0

user table
user_id

entry
user_id
points_a
points_b

SELECT user.*, 
(SUM(entry.points_a) + SUM(entry.points_b)) as points_total
FROM user
LEFT JOIN entry on entry.user_id = entry.user_id

..is what I’m trying to do — get a total count of all points that a user has. The field type for points is INT. This Doesn’t seem to work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:10:48+00:00Added an answer on May 24, 2026 at 10:10 pm

    Given that you have no columns in user except the ID, the join really serves no purpose.

    select userid, SUM(points_a) + SUM(points_b) as total
    from entry
    group by userid
    

    This will give you what you are looking for. If you need more fields from the user table that you just didn’t show, you can do the join and add those fields to the select.

    I think what you were missing was the Group By clause though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a table that has user_id, date, score, and every user
I have a table that represents a user's entries: User_ID | Entry_ID Now I
I am trying to make a simple web app. I have a User table
Say I have a 'user_log' table with the following field: id user_id status_text timestamp
I have a table that contains intervals: CREATE TABLE tbl ( user_id: INTEGER, start:
I have a couple of tables which look like this Table 1 user_id |
I have a user table 'users' that has fields like: id first_name last_name ...
My User table I want to map to aspnet_Users: <class name=User table=`User`> <id name=ID
I currently have the following row in my table: course_data: user_id days <-- This
I have a table of userdata that includes user ID and category IDs. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.