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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:18:26+00:00 2026-06-11T02:18:26+00:00

I have 2 tables that I’m trying to combine in order to do a

  • 0

I have 2 tables that I’m trying to combine in order to do a group by function on them. The reason I’m dealing with this issue is that combined the 2 tables are > than the 10 GB database limit in SQL Server Express (each is ~ 9 GB). The second table is just a continuation of the first. It looks like this:

  CustId        Sale
    001         4.25
    002        15.24
    003         8.78
    004       122.99
    005        44.80
    ...         ...

If it was one table I’d just use something like this:

select CustId, sum(Sale) sumSale
from table1
group by CustId

Is there a way to combine lengthwise instead of width-wise?

  • 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-11T02:18:28+00:00Added an answer on June 11, 2026 at 2:18 am

    You can use a union:

    select CustId, sum(Sale) sumSale
    from (
        select CustId, Sale
        from table1
        union all
        select CustId, Sale
        from table2)
    group by CustId
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several tables that I am selecting data from. I am trying to
I have two tables that model an inheritance relationship. This is expressed by a
I have two tables that look something like this: Checkpoint with field: Checkpoint_id Checkpoint_name
I have 2 tables that look like this: Table public.phone_lists Column | Type |
I have 3 tables that look like this: tblVideo: VideoID | Video Name 1
I have two tables that look like this: Table: cases id name status case_no
I have 2 tables that I'm trying to use to perform some calculations. My
I have 2 tables that look like this: users (uid, name) ------------------- | 1
I have 2 tables that Im trying to select 4 results from ordered by
I have two tables that have a foreign key constraint between them Table event

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.