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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:08:38+00:00 2026-06-15T06:08:38+00:00

Okay, say that I have two columns, Person and Donation. With, for example, these

  • 0

Okay, say that I have two columns, Person and Donation. With, for example, these as rows:

+++++++++++++++
Fred | $1000 
Fred |  $500 
Bob  | $1000
Bob  | $7000
Sally|  $500
Joe  |  $100  
+++++++++++++++

How could I get it to display the following?

+++++++++++++++
Fred | $1500
Bob  | $8000
Sally|  $500
Joe  |  $100  
+++++++++++++++

In other words, how could I group together all the donations under a certain person, and sum them up? What would be an example query that would accomplish this? (If at all possible, in a general way, that does not involve individually naming the people in the select/sum clause)

Thanks!

  • 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-15T06:08:40+00:00Added an answer on June 15, 2026 at 6:08 am

    When you use a GROUP BY clause with an aggregate function (like SUM) the aggregate is calculated for each group.

    SELECT Name, SUM(Donation) FROM Donations GROUP BY Name
    

    If you want to get more specific results, like those people with total donations more than $500, introduce a HAVING clause. This is sort of like a WHERE for aggregate results:

    SELECT Name, SUM(Donation) FROM Donations GROUP BY Name 
        HAVING SUM(Donation) > 500
    

    SQL Fiddle: http://sqlfiddle.com/#!2/2de84/1/0

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

Sidebar

Related Questions

Okay, so let's say I have a mysql database table with two columns, one
Okay so let's say I have class A... CLASS A has a method that
Say I have two lists or arrays of strings. For example: list 1: a,
Okay, let's say that I have b.exe, which takes a string argument. I want
Okay so say I have a form element like this: HTML: <div class=form-item> <label>Current
Okay, next PHPExcel question. I have an HTML form that users fill out and
okay, i'm setting up a multi-user chat system. i have a messages table, that
Say I have a tableview class that lists 100 Foo objects. It has: @property
I'm wondering if it's considered okay (particularly, in Django) to have a URL that's
So, let's say that I have a VBA application inside of whatever Office Application.

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.