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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:40:37+00:00 2026-05-20T07:40:37+00:00

I just cant seem to get my head around this problem, so thought I

  • 0

I just cant seem to get my head around this problem, so thought I would ask it here.
The system I’m making is a system where farmers can claim subsidy for the crops / animals. Each farmer is allocated to a specific region. What I need to do is to get the total claims made by each region. Here’s my tables:
enter image description here

So what I need to do again is to take the sum of total from the claims table but group that by region. I already know how to do it for one specific region, but I would like to select all the regions in one query.

Thanks for your help, much appreciated!

  • 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-20T07:40:38+00:00Added an answer on May 20, 2026 at 7:40 am
    select 
          farmer.region_id,
          sum( claims.total ) TotalClaims
       from 
          claims
             join farmer
               on claims.farmer_id = farmer.id
             join regions
               on farmer.region_id = regions.id
       group by
          farmer.region_id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I cant seem to get my head around how to create this Each Bold
I've just started using jQuery, and can't get my head around this. I need
I am sure this is straight forward but I just cant seem to get
I have this issue that I can't seem to get my head around... Basically
I can't seem to get my head around this. I need to build some
This shouldn't be so hard but I just can't seem to get this to
Im sure this is pretty simple but I just cant seem to find the
I can't seem to get my head around these rewrite rules for some reason
I'm trying to get my head around this behaviour: I have a ListView on
I know this has been addressed many times, but i just cant seem 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.