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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:25:14+00:00 2026-05-29T13:25:14+00:00

I have to get data from two SQL tables but I am unsure of

  • 0

I have to get data from two SQL tables but I am unsure of what join to use and the same tables have the same customers_id table would I use an inner join?

table - customers

customers_id
customers_firstname
customers_lastname
customers_email_address

table - orders


customers_id
customers_street_address
customers_suburb
customers_city
customers_postcode
customers_state
customers_country
  • 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-29T13:25:15+00:00Added an answer on May 29, 2026 at 1:25 pm

    It depends on what results you want. If you want every record in Customers regardless of whether there is a matching record in orders the you would use an LEFT OUTER JOIN. If not you would use an INNER JOIN. This is the article I typically refer people to for a basic explanation of joins.

    An INNER JOIN would look like this:

    SELECT c.customers_id, 
           c.customers_firstname, 
           c.customers_lastname, 
           o.customers_street_address,
           o.customers_city,
           o.customers_postcode,
           o.customers_state
    FROM customers as c
    INNER JOIN orders as o
    ON c.customers_id = o.customers_id
    

    I purposely did not do select *. Try to get into the habit of only selecting the columns you want from tables instead of everything.

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

Sidebar

Related Questions

I want to join two tables together and have ONLY the data in Table
I'm simply trying to get data from two sql server db tables using ado.net
I have to get data from Oracle Table in which I have one datefield
I have a main table that I must get data from. I have a
I have to use several SOAP messages to get data from a web service.
I have to come up with a way to get data from a SQL
I have a doubt i use the following piece of code get data from
I have a report that needs to get data from two logical areas of
I am developing an application in which i have to get data from .xls
I have an app that must get data from the Sqlite database in order

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.