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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:03:00+00:00 2026-06-11T10:03:00+00:00

I need to do a join on two tables, I need EVERYTHING from table

  • 0

I need to do a join on two tables, I need EVERYTHING from table A, and just the stuff from table B where the ‘REF’ for each row, is not already in table A’s results.

Key Facts:
Table B contains the complete amount of ID’s/Names however all the other information is blank. Its basically just a table with all employee’s name’s and id’s but its a complete list.
Table A contains a limited amount of results but all the other columns have data in them.

What I need is to use Table B as a complete reference rather than just see what exists in table A so basically:

“Show me everything from table A, and add the extra people’s details
found in table B where they dont already exist in table A to give me a complete result set”

select
ID,
Name,
StartDate,
EndDate,
State,
Status,
Comment,
IsComment
from
tableA


select
ID,
Name,
StartDate,
EndDate,
State,
Status,
Comment,
IsComment
from
tableB

Table A contents:

ID       Name     START_DATE       END_DATE      STATE    Status     Comment    Is_Comment
6760    chris       2012-09-03      2012-09-09   4       Applied                   0
6524     dave     2012-09-03        2012-09-09    4        Applied                 0
4268     james    2012-09-03        2012-09-09    4        Applied    Friday-Off   1
7851     rob      2012-09-03        2012-09-09    4       Applied                  0

Table B contents

    ID        Name     START_DATE       END_DATE      STATE    Status     Comment    Is_Comment
    6760    Chris   
    6524    dave    
    4268    james   
    7851    rob      
    4521    ryan
    5698   julie
    4596    rory
    1111     mary
    5621     owain
    9999     jacob

After the join what I want to see:

    ID       Name     START_DATE       END_DATE      STATE    Status     Comment    Is_Comment

    6760    chris       2012-09-03      2012-09-09   4       Applied                   0
    6524     dave     2012-09-03        2012-09-09    4        Applied                 0
    4268     james    2012-09-03        2012-09-09    4        Applied    Friday-Off   1
    7851     rob      2012-09-03        2012-09-09    4       Applied                  0   
   4521    ryan
   5698    julie
   4596    rory
  1111     mary
  5621     owain
  9999     jacob
  • 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-11T10:03:01+00:00Added an answer on June 11, 2026 at 10:03 am

    Use a Left join

    SELECT [columnsListYouNeed]
    FROM  TableB 
    LEFT JOIN TableA ON TableA.ID = TableB.ID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to Join two tables where each row in the first table get
I need to join two tables from different MySQL (PHP) connection strings and different
I need to join two tables, i already have the code for the first
i have a need to join two tables from different databases. code will look
I'm trying to join two tables from DB but I need to join them
I need to join two tables into a relational table. I know that I
I want to left join two tables. My problem is that the table from
I need to join two tables called MSISDN and RANGES. Example: MSISDN table: MSISDN
I have 3 tables I need to join. The contracts table is the main
I need help regarding JOIN tables to get category name & author name from

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.