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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:35:53+00:00 2026-06-12T19:35:53+00:00

I am struggling with combining the below Select Statments, I know I could cheat

  • 0

I am struggling with combining the below Select Statments, I know I could cheat and add some fake columns in and then use Union, but I want to do this correctly.
Once I have them joined, I will be putting the Statment in to a XML file for use with Word and CRM4.

SELECT BILLTO_NAME, 
       BILLTO_LINE1, 
       BILLTO_LINE2, 
       BILLTO_LINE3, 
       BILLTO_CITY, 
       BILLTO_COUNTRY, 
       BILLTO_POSTALCODE, 
       ORDERNUMBER, 
       REQUESTDELIVERYBY, 
       MODIFIEDON, 
       SHIPTO_NAME, 
       SHIPTO_LINE1, 
       SHIPTO_LINE2, 
       SHIPTO_LINE3, 
       SHIPTO_CITY, 
       SHIPTO_STATEORPROVINCE, 
       SHIPTO_COUNTRY, 
       SHIPTO_POSTALCODE, 
       CREATEDBY 
FROM   SALESORDERBASE 



SELECT QUANTITY, 
       DESCRIPTION 
FROM   SALESORDERDETAILBASE 

SELECT NEW_ORDERNOTES, 
       NEW_NOTES 
FROM   SALESORDEREXTENSIONBASE 

They all have the common column of SalesOrderID, which I need to add in somewhere as well.

  • 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-12T19:35:54+00:00Added an answer on June 12, 2026 at 7:35 pm

    You can use a LEFT JOIN on the tables:

    SELECT ob.SalesOrderID 
           ob.BILLTO_NAME, 
           ob.BILLTO_LINE1, 
           ob.BILLTO_LINE2, 
           ob.BILLTO_LINE3, 
           ob.BILLTO_CITY, 
           ob.BILLTO_COUNTRY, 
           ob.BILLTO_POSTALCODE, 
           ob.ORDERNUMBER, 
           ob.REQUESTDELIVERYBY, 
           ob.MODIFIEDON, 
           ob.SHIPTO_NAME, 
           ob.SHIPTO_LINE1, 
           ob.SHIPTO_LINE2, 
           ob.SHIPTO_LINE3, 
           ob.SHIPTO_CITY, 
           ob.SHIPTO_STATEORPROVINCE, 
           ob.SHIPTO_COUNTRY, 
           ob.SHIPTO_POSTALCODE, 
           ob.CREATEDBY,
           od.QUANTITY,
           od.DESCRIPTION,
           oe.NEW_ORDERNOTES,
           oe.NEW_NOTES
    FROM   SALESORDERBASE ob
    LEFT JOIN SALESORDERDETAILBASE od
        on ob.SalesOrderID = od.SalesOrderID
    LEFT JOIN SALESORDEREXTENSIONBASE oe
        on ob.SalesOrderID = oe.SalesOrderID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Struggling with one aspect of my code that I hope someone could shed some
After struggling with some maps I came to the point where I don't know
I am using Xcode and, after some struggling, it is compiling my dynamic libraries
currently I'm struggling with maps which should contain themselves. But I don't know the
I'm struggling trying to read a php file inside a php and do some
I'm struggling combining a tabbed ActionBar and fragments . I'm using ActionBarSherlock to display
Struggling between choosing linq2sql and nhibernate. Let me give you some insight in the
I'm struggling with some basic MVVM design principles in a Silverlight 4 app using
Struggling to find a bit of code to easily understand. How do you add
I have almost finished a website, but I'm struggling with combining two different javascript

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.