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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:01:32+00:00 2026-06-16T03:01:32+00:00

In SQL server 2008, I have the following two tables Table_1: C1 C2 A

  • 0

In SQL server 2008, I have the following two tables

  Table_1:
C1  C2
A   TypeStringA-1
B   TypeStringA-2
C   TypeStringA-3
D   TypeStringA-4
E   TypeStringA-5

  Table_2
C1  C2
A   TypeStringB-1
B   TypeStringB-2
D   TypeStringB-3
E   TypeStringB-4

And I want to show the following data:

  Result
A  TypeStringA-1 TypeStringB-1
B  TypeStringA-2 TypeStringB-2
C  TypeStringA-3 Null
D  TypeStringA-4 TypeStringB-3
E  TypeStringA-5 TypeStringB-4

Right now what I have is two sub-queries and a where:

select
query1.C1
query1.C2
query2.C2
(select C1, C2 
from Table_1) as query1
(select C2
from table_2) as query2
where query1.C1 = query2.C1
order by query1.C1

However logically in my result I am not having the Null data that I need to show, this is what I am getting:

  Result
A  TypeStringA-1 TypeStringB-1
B  TypeStringA-2 TypeStringB-2
D  TypeStringA-4 TypeStringB-3
E  TypeStringA-5 TypeStringB-4

The question is what should I use to shot the table as I want with a Null data?.

  • 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-16T03:01:33+00:00Added an answer on June 16, 2026 at 3:01 am
    select  coalesce(t1.C1, t2.C1)
    ,       t1.C2
    ,       t2.C2
    from    Table_1 t1
    full outer join
            Table2 t2
    on      t1.C1 = t2.C1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SQL Server 2008 Two tables: Table A has following data: RowA RowB RowC RowD
I have two tables in a SQL Server 2008 environment with the following structure
I have the following two tables. I am using SQL Server 2008 R2 Create
In SQL Server 2008: I have two tables, dtlScheme and dtlRenewal, with a one
In SQL Server 2008 I have two tables. One table for users: id_user -
I have two tables in a SQL Server 2008 database in my company. The
In SQL server 2008: Suppose I have two tables. Table1 has 3 fields: Name,
I have a SQL Server 2008 R2 database. This database has two tables called
I have two tables with identical schema in SQL Server 2008 R2. If I
I am experiencing an unclear sql server 2008 deadlock. I have two tables: T1:

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.