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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:42:03+00:00 2026-05-30T18:42:03+00:00

Common problem which I know the SQL gurus out there will be able to

  • 0

Common problem which I know the SQL gurus out there will be able to help. Say I have a table like so:

Quarter  | Month  |  Group  |  Member  |  Value
Q1 2011  | Jan    |  10     |  343     | 10
Q1 2011  | Jan    |  1      |  3       | 10
Q1 2011  | Jan    |  4      |  6       | 10
Q1 2011  | Feb    |  34     |  33      | 10
Q1 2011  | Feb    |  5      |  6       | 10
Q1 2011  | Mar    |  54     |  33      | 10
Q2 2011  | Apr    |  76     |  33      | 10
Q2 2011  | May    |  98     |  33      | 10
Q2 2011  | May    |  9      |  1       | 10
...

I want to group by so that I get the months and quarters summed together so that it is now:

Quarter  | Month  |  Group  |  Member  |  Value
Q1 2011  | Jan    |  15     |  352     | 30
Q1 2011  | Feb    |  39     |  39      | 20
...

Help!

  • 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-30T18:42:05+00:00Added an answer on May 30, 2026 at 6:42 pm

    A straightforward use of the GROUP BY clause will work for you:

    SELECT [Quarter], [Month], SUM([Group]) as [Group], SUM([Member]) as Member, 
      SUM([Value]) as [Value]
    FROM dbo.YourTableName
    GROUP BY [Quarter], [Month]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a common problem of moving our development SQL 2005 database onto shared
I'm sure this is a common problem, I don't know if there is a
Common problem I'm sure, but I can't figure it out. In my AndroidManifest.xml and
I have a quite common problem, as I saw in the various user groups
This seems like a very simple and a very common problem. The simplest example
I have come across what must be a common problem. When I have an
I have a table in which the even rows have a colspan spanning the
I am sure this a pretty common problem: I have a UITableView with quite
I am currently facing a, in my opinion, rather common problem which should be
I presume this isn't a common problem, which makes it a bit more difficult

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.