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 7891177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:33:06+00:00 2026-06-03T06:33:06+00:00

I am trying to run a SQL Query in phpmyadmin that will total multiple

  • 0

I am trying to run a SQL Query in phpmyadmin that will total multiple rows and insert that total into the cell.

The file is sorted by date and then a few other specifics.

I am just having a hard time finding the syntax for it.

Basically I have one column called ‘Points’ and another called ‘Total_Points’

It needs to look like this:

+--------+--------------+
| Points | Total Points |
+--------+--------------+
|   10   |      10      |
|   10   |      20      |
|   10   |      30      |
|   10   |      40      |
+--------+--------------+

And so on and so on.
It seems like there has to be something out there that would do this and I am just missing it

  • 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-06-03T06:33:07+00:00Added an answer on June 3, 2026 at 6:33 am

    For a running sum you can use “window functions” like this:

    create table tbl(ord int, points int);
    insert into tbl values(1, 10),(2, 10), (3, 10), (4, 10);
    
    select
        *,
        sum(points) over w total_points
    from tbl
    window w as (order by ord);
    
     ord | points | total_points 
    -----+--------+--------------
       1 |     10 |           10
       2 |     10 |           20
       3 |     10 |           30
       4 |     10 |           40
    

    I “aggregated” your ORDER BY criteria to be the column ord. You may of course replace it.

    Besides of this: You did not specify a concrete database vendor. My example runs on PostgreSQL. Other SQL dialects may be a little different.

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

Sidebar

Related Questions

I am trying to run a SQL query (SQL Server) that will look up
i am trying to run a sql query which will not show distinct/duplicate values.
I'm trying to form a query string from multiple checkboxes that will be used
I'm trying to run a LINQ to SQL query that returns a result in
I have the following SQL query that I am trying to run inside Microsoft
I'm currently trying to run a LINQ query over a MS SQL database. This
I've run into a syntax issue with SQL. What I'm trying to do here
I am trying to insert data from a csv file into mysql using BigDump.
I am trying to run a Linq-to-SQL query, but when the query is evaluated,
With PHP I'm trying to run a SQL query and select normal columns as

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.