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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:39:50+00:00 2026-06-09T03:39:50+00:00

Hi I am just learning SQL and i am trying to retrieve some data

  • 0

Hi I am just learning SQL and i am trying to retrieve some data from multiple tables and cannot get it to display how I would like it, so i am just wondering if this is possible or not, and if so could someone suggest a method, see below:

    Table1:                     Table2:                     Table3

    Package       Licenses      Package       Licenses      Package      Licenses
    ======================      ======================      =====================
    Product1         20         Product1         15         Product1        0
    Product2         15         Product2         5          Product2        5
    Product3         10         Product3         10         Product3        0

I would like the values in the Licenses columns to be added to each other according to the package name and it to display something like this if possible:

    Package       Licenses
    ======================
    Product1         35
    Product2         25
    Product3         20

If someone could let me know how this could be done, if such a thing is even possible please let me know.

  • 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-09T03:39:51+00:00Added an answer on June 9, 2026 at 3:39 am

    Try this:

    SELECT Package, SUM(Licences) as TotalLicences
      FROM (
            SELECT Package, Licences FROM Table1
             UNION ALL
            SELECT Package, Licences FROM Table2
             UNION ALL
            SELECT Package, Licences FROM Table3
           ) AS AllLicences
     GROUP BY Package
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just switching from C to C# and would like to invest sometime
I just started learning SQL a couple of days ago, and I'm trying to
I am just starting my journey into learning databases/SQL and the like. I decided
I just started learning LINQ to SQL, and so far I'm impressed with the
Just learning the world of jquery, and all my googling gives examples like this:
Just learning C#, radiobuttons and checkboxes. No urgency. The code works to display the
Im just learning mod_rewrite and regex stuff, and what I'm trying to do is
Im just learning SQLite and I can't get my parameters to compile into the
I'm just learning how to use iterators over vectors, and I'm having some trouble
I am just learning sql and starting with PostgreSQL. Here is what I am

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.