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

The Archive Base Latest Questions

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

I have a fairly conventional set of order entry tables divided by: Orders OrdersRows

  • 0

I have a fairly conventional set of order entry tables divided by:

Orders
OrdersRows
OrdersRowsOptions

The record in OrderRowOptions is not created unless needed. When I create a set of joins like

select * from orders o 
  inner join OrdersRows r on r.idOrder = o.idOrder 
  inner join ordersrowsoptions ro on ro.idOrderRow = r.idOrderRow
where  r.idProduct = [foo]

My full resultset is blank if no ordersrowsoptions records exist for the given product.

what’s the correct syntax to return records even if no records exist at one of the join clauses?

thx

  • 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-16T05:37:20+00:00Added an answer on May 16, 2026 at 5:37 am
    select * from orders o  
      inner join OrdersRows r on r.idOrder = o.idOrder  
      left join ordersrowsoptions ro on ro.idOrderRow = r.idOrderRow 
    where  r.idProduct = [foo] 
    

    Of course you should not use select * in any query but especially never when doing a join. The repeated fields are just wasting server and network resources.

    Since you seem unfamiliar with left joins, you probably also need to understand the concepts in this:
    http://wiki.lessthandot.com/index.php/WHERE_conditions_on_a_LEFT_JOIN

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

Sidebar

Related Questions

I have a fairly complex set of rewrite rules to give my site pages
I have fairly simple problem but I can not think of the simple solution.
I have a fairly conventional Grails application. It's monolithic; although it's somewhat split into
We have a fairly large member site set up on AWS using a medium
I have (I thought) a fairly conventional WPF app. I've <ListBox ItemsSource={Binding MyList} ...
I have fairly large set of data returned via AJAX from a page. This
I have a fairly large Excel file. In this file there is a column
I have a fairly specific question about concurrent programming in C. I have done
I have a fairly standard OLTP normalised database and I have realised that I
I have a fairly complicated installer that I'm writing in Wix that has a

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.