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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:55:17+00:00 2026-06-11T07:55:17+00:00

Does anyone have a really good example where there are two tables with a

  • 0

Does anyone have a really good example where there are two tables with a OneToMany relationship where doing a left join with Table B as the target would be less useful than just doing a left join with table A as the target using the WHERE clause.

Table A (ManyToOne with Table B)
Pk
Number
Fk

Table B
Pk
IsActive

I mean, I can write a join like so

select * from TableA as a left outer join TableB as b on b.pk=a.fk where b.isActive=false and a.Number < 15

instead of writing

select * from TableB as b left outer join TableA as a on b.pk=a.fk where b.isActive=false and a.Number < 15

I mean, if I was supporting joins on a noSQL system, when would I ever need to support the second one because someone could not just rewrite it as the first one above AND is there a good use case for this so I can wrap my head around when it would be used?

The reason I ask is in object query language, I am wondering if I ever need to support doing a where clause in this situation(or instead if I just disallow something like this)…

 select b from TableB as b left fetch join b.tableAList as a where b.isActive=true and a.xxxxx = something

but isn’t that invalid since b has many a rows so a.xxxx is invalid as it is a list and could only really be a.size which would be count of the rows in the list of a rows for that b row.

thanks,
Dean

  • 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-11T07:55:19+00:00Added an answer on June 11, 2026 at 7:55 am

    Both of your examples are effectively inner joins.

    When you do a left outer join, the values in the second table are NULL. Your WHERE clause is:

    where b.isActive=false and a.Number < 15
    

    NULL values will cause this to fail, removing all the “virtual” rows added from the second table.

    If you really want a left outer join, then you need to include these in the ON clause rather than the WHERE clause.

    In general, though, A LEFT OUTER JOIN B and B LEFT OUTER JOIN A are quite different. The first keeps all rows in A, with the matching rows from B (or NULL values if there is no match). The second keeps all rows in B, with all the matching rows from A (or NULL values if there is no match).

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

Sidebar

Related Questions

Does anyone have any good references for equations which can be implemented relatively easily
Does anyone know if there's a good tool for analyzing JavaScript code and detecting
Possible Duplicate: Does anyone have a good Proper Case algorithm I am currently in
Does anyone know a good online resource for example of R code? The programs
Does anyone have a translate function for x/y positions after rotation in javascript? for
Does anyone have recommendations on the best Online Store for non-technical users of Joomla?
Does anyone have an idea on where is it best to upload a PHP
Does anyone have any examples on how to integrate a task scheduler in Bottle.
Does anyone have an idea of how to capture logs continuously and update a
does anyone have a nice solution to get de price wich is a variable

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.