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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:40:45+00:00 2026-05-28T04:40:45+00:00

I have multiple product sales in different markets, and I need to sum up

  • 0

I have multiple product sales in different markets, and I need to sum up the totals for each title. To start:

mysql> SELECT title, partner_share_currency, us_earnings_usd, cad_earnings_cad 
        FROM raw_financials WHERE title LIKE "%Gamers%";
+--------+------------------------+-----------------+------------------+
| title  | partner_share_currency | us_earnings_usd | cad_earnings_cad |
+--------+------------------------+-----------------+------------------+
| Gamers | USD                    |          3.2500 |           0.0000 |
| Gamers | CAD                    |          0.0000 |           4.0000 |
| Gamers | USD                    |          4.5000 |           0.0000 |
+--------+------------------------+-----------------+------------------+

This is what I currently am doing to get the GROUP BY title:

mysql> SELECT title, us_earnings_usd, cad_earnings_cad 
        FROM raw_financials WHERE title LIKE "%Gamers%" GROUP BY title;
+--------+-----------------+------------------+
| title  | us_earnings_usd | cad_earnings_cad |
+--------+-----------------+------------------+
| Gamers |          3.2500 |           0.0000 |
+--------+-----------------+------------------+

As you can see, it does not sum the value rows. How would I change the SELECT statement such that it sums up the value rows, to give me:

+--------+-----------------+------------------+
| title  | us_earnings_usd | cad_earnings_cad |
+--------+-----------------+------------------+
| Gamers |          7.7500 |           4.0000 |
+--------+-----------------+------------------+
  • 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-28T04:40:45+00:00Added an answer on May 28, 2026 at 4:40 am

    Try something like:

    mysql> SELECT title, SUM(us_earnings_usd) AS us_earnings_usd, SUM(cad_earnings_cad) AS cad_earnings_cad
            FROM raw_financials WHERE title LIKE "%Gamers%" GROUP BY title;
    

    SUM is a function that will operate on each group when you have that GROUP BY clause on your statement. For more similar functions, see MySQL aggregate functions.

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

Sidebar

Related Questions

I have a database with these tables: products,colors,sizes Each product(t-shirts,jeans etc) can have multiple
I have a PRODUCTS table, and each product can have multiple attributes so I
I have a Store Model that can have multiple products. Each product has a
I have multiple product tables (not related to each other). All products tables having
I have a database table which stores products. Each product can have multiple colours.
I have a products table containing products. Each product can have multiple images. The
I had another form to upload the details of 1 product which have multiple
I have a single product table with multiple fields which contain user evaluations of
Let's say I have a site with multiple links as follows: www.example.com/product/1 www.example.com/product/2 www.example.com/product/3
I have multiple ajax requests with javascript code as response, and I need to

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.