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

  • Home
  • SEARCH
  • 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 6186543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:54:23+00:00 2026-05-24T01:54:23+00:00

I have a MySQL table comment with the following fields: loginid submissionid points I

  • 0

I have a MySQL table comment with the following fields:

loginid submissionid points 

I have a MySQL table called submission with the following fields:

loginid submissionid

For a given submissionid, the loginid in the two tables represent different things and therefore do nor correspond.

I would like a join to sum up points by loginid. However, not by the loginid in comment, but rather the loginid in submission. The connection between the two tables is made via the submissionid

I can’t get this to work. Below is what I have so far. I’m trying to get this desired sum for each loginid pulled from another, third table, which is what the l.loginid represents.

How can I do this?

LEFT JOIN (
    SELECT C2.submissionid, C2.loginid SUM(points) AS total 
    FROM comment C2
    INNER JOIN submission S2
    ON S2.submissionid = C2.submissionid
    GROUP BY C2.submissionid
) cscs ON cscs.loginid = l.loginid
  • 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-24T01:54:24+00:00Added an answer on May 24, 2026 at 1:54 am
    SELECT S2.loginid, SUM(points) AS total 
    FROM submission S2
    INNER JOIN comment C2
    ON S2.submissionid = C2.submissionid
    GROUP BY S2.loginid
    

    This will give you a points sum for each loginid in the submission table.

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

Sidebar

Related Questions

I have a 'Comments' MySQL table that has the following fields: id text parent_id
If I have two tables with following columns: Table1: [id,value] Table2: [id,comment] where id
I have this mysql table called comments which looks like this: commentID parentID type
I have a MySQL table LOGIN_LOG with fields ID, PLAYER, TIMESTAMP and ACTION. ACTION
I have MySQL table with the following structure: +---------+--------------+------+-----+---------+----------------+ | Field | Type |
I have the following table: http://kimag.es/share/59074317.png columns = [id cid comment] I need a
I have the following three tables in a MySQL database in order to give
I have a column with datetime datatype called 'updated_at' in a mysql table,where i
I have mysql table that has a column that stores xml as a string.
I have a MySQL table with approximately 3000 rows per user. One of the

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.