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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:47:59+00:00 2026-06-09T16:47:59+00:00

I have tow tables named TableA and TableB Let us say TableA Id TableAName

  • 0

I have tow tables named TableA and TableB

Let us say TableA

Id   TableAName 
------------------
 1     11
 2     12
 3     13
 4     14
 5     15

Let us say TableB

Id   TableBName 
----------------
 1     11
 2     22
 3     23
 4     24
 5     25

I want result like below

 TableAName  TableBName
-------------------------
   11           11
   12           Null
   13           Null 
   14           Null  
   15           Null
   Null         22
   Null         23
   Null         24
   Null         25

I am confuse to get this result. I need records , if both column has same value than display in one row , otherwise not.

How can I do this ?

  • 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-09T16:48:01+00:00Added an answer on June 9, 2026 at 4:48 pm

    Standard SQL:

    SELECT
      A.TableAName, B.TableBName
    FROM
      TableA A
      FULL OUTER JOIN
      TableB B ON A.TableAName = B.TableBName
    

    MySQL does not support FULL OUTER JOIN

    SELECT
      A.TableAName, B.TableBName
    FROM
      TableA A
      LEFT OUTER JOIN
      TableB B ON A.TableAName = B.TableBName
    UNION
    SELECT
      A.TableAName, B.TableBName
    FROM
      TableA A
      RIGHT OUTER JOIN
      TableB B ON A.TableAName = B.TableBName
    

    Edit, taken from @Dems deleted answer

    You can add this to get the same order as above

    ORDER BY
         COALESCE(A.TableAName, B.TableAName)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tow tables concept_access and concept_access_log. I want to create a trigger that
I have a set of files named like: Friends - 6x03 - Tow Ross'
C# WinForms: I would like to have two Toolbars But I also want them
I have data like following table I want to remove Titles ( Mr. Miss,
I have tow variables in my mvc application .that is shown below public IEnumerable<SelectListItem>
i have tow input, style column and mediumCell. i want first input only have
I have a string which is like AB-123,XYZ-456,AB-11,AB-3423,XYZ-1 I want to separate out all
I have tow tables in my MySQL database - one with flights and one
I have tow tables where User (id,name) and UserInfo (user_id,email,date_edit) How i can do
I write a project using Prism . I have tow modules and this modules

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.