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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:41:02+00:00 2026-06-05T02:41:02+00:00

I have two tables on MySQL (using phpMyAdmin), looking like the following: Table 1:

  • 0

I have two tables on MySQL (using phpMyAdmin), looking like the following:
Table 1:

Country    Total Minutes
USA        100
USA        90
Canada     60
Mexico     80
UK         90
France     70
France     10
Germany    10

In Table 2, what I need to do is the following:

Region           Total Minutes
North America    USA+USA+Canada+Mexico Mins
Europe           UK+France+France+Germany Mins

Is there a way to have a row be the result of a query?

  • 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-05T02:41:06+00:00Added an answer on June 5, 2026 at 2:41 am

    You either need a region column in table 1:

    SELECT region, SUM(`Total Minutes`)
    FROM timespent
    GROUP BY region;
    

    Or a separate region <-> country table:

    SELECT region, SUM(`Total Minutes`)
    FROM myregions r
    INNER JOIN timespent t USING (country)
    GROUP BY r.region;
    

    The regions table would look like this:

    region        | country
    --------------+--------
    North America | USA
    North America | Mexico
    

    If you can’t change anything in your database, look at Andomar’s solution 🙂

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

Sidebar

Related Questions

using php and mysql I have two tables, a users table and a profiles
using mysql and php, I have two tables, I'm french so the table names
I have two mysql tables that have the following structure: Table 1: ---ID---------NAME------- ---1-----
I have two MySql tables like the following: Cat ------ id : INT NOT
USING MySQL. I have two tables. Table A, and Table B. Table A has
I'm using PHP/MySql. If I have two tables (hypothetically) as follows: id name and
I am using MYSQL and PHP. I have a table called item. Two of
I have two tables in a MySql database: COUNTRY --------------- id, country_name and CITY
I have two mySQL tables as follows: [product] table P_id | Name | Quantity
I have two MySql tables as shown below with the data shown: CREATE TABLE

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.