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

  • Home
  • SEARCH
  • 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 3311026
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:49:42+00:00 2026-05-17T21:49:42+00:00

Hey guys, So I have this report that I am grouping into different age

  • 0

Hey guys,
So I have this report that I am grouping into different age buckets. I want the count of an age bucket to be zero if there are no rows associated with this age bucket. So I did an outer join in my database select and that works fine. However, I need to add a group based on another column in my database.

When I add this group, the agebuckets that had no rows associated with them dissapear. I thought it might have been because the column that I was trying to group by was null for that row, so I added a row number to my select, and then grouped by that (I basically just need to group by each row and I can’t just put it in the details… I can explain more about this if necessary). But after adding the row number the agebuckets that have no data are still null! When I remove this group that I added I get all age buckets.

Any ideas? Thanks!!

  • 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-17T21:49:43+00:00Added an answer on May 17, 2026 at 9:49 pm

    It’s because the outer join to age group is not also an outer join to whatever your other
    group is – you are only guaranteed to have one of each age group per data set, not one of each age group per [other group].

    So if, for example, your other group is Region, you need a Cartesian / Cross join from your age range table to a Region table (so that you get every possible combination of age range and region), before outer joining to the rest of your dataset.

    EDIT – based on the comments, a query like the following should work:

    select date_helper.date_description, c.case_number, e.event_number
    from 
    (select 0 range_start, 11 range_end, '0-10 days' date_description from dual union
     select 11, 21, '11-20 days' from dual union  
     select 21, 31, '21-30 days' from dual union  
     select 31, 99999, '31+ days' from dual) date_helper
    cross join case_table c
    left outer join event_table e
    on e.event_date <= date_helper.range_start*-1 + sysdate 
    and e.event_date > date_helper.range_end*-1 + sysdate
    and c.case_number = e.case_number
    

    (assuming that it’s the event_date that needs to be grouped into buckets.)

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

Sidebar

Related Questions

Hey guys I simply cannot get this to work. I have some content that
Hey guys, I have this quick bit of code that I can't figure out
hey there guys and girls i have this code that saves json as a
Hey guys. I have a method that gets called each second which I want
Hey guys, I have this query. SELECT COUNT(purchase_log.id), purchase_log.date_purchased, purchase_log.total_cost, purchase_log.payment_status, cart_contents.product_name, members.first_name, members.last_name,
Hey guys, I have this code within a function inside a class that is
Hey guys, I just started learning C++ and I have this code that I
hey guys having this really simple problem but cant seem to figure out have
Hey guys, this is simple but I can't make it workn... blah! I have
Hey guys I have an admin page that checks if you are admin before

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.