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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:20:24+00:00 2026-06-01T23:20:24+00:00

I created two tables below, and FK_TypeID is nullable in this case. I want

  • 0

I created two tables below, and FK_TypeID is nullable in this case. I want to write a query returning me the join of two tables.

if FK_TypeID is NULL for a certain row, the TypeName is also NULL. I am not sure how to go about creating such join statement?

[Actions]
ActionsID
Date
Message
FK_TypeID //links to the table below

[Type]
TypeID
TypeName

My current statment looks like this and it simply skips NULL FK_TypeID rows

SELECT        *
FROM            Actions 
INNER JOIN      TypeName ON Actions.FK_TypeID = [Type].TypeID

Help would be greatly appreciated!

  • 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-01T23:20:26+00:00Added an answer on June 1, 2026 at 11:20 pm

    You just need to use a LEFT JOIN

    SELECT Actions.Date, Actions.Message, Type.TypeName
    FROM Actions
        LEFT JOIN Type 
            ON Type.TypeID = Actions.FK_TypeID
    

    If a match to Actions is not found to tie it with Type, then all columns in Type will be NULL.

    Here is a good graphical visualization of the different types of joins in SQL

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

Sidebar

Related Questions

I have two tables afrostarprofiles and afrostarvvideos created as shown below. artistid field in
Two tables (Teachers and Students) are created while the Id in Students is referenced
First.. here are the two tables I've created (sans irrelevant columns).. CREATE TABLE users_history1
I have two auditing tables: Trip_aud and Event_aud. They were created in Envers, but
So I have two tables structured like so: CREATE TABLE #nodes(node int NOT NULL);
In SSRS I have created two tables, a parent and a subreport. Both reports
I have two tables salary_structures and payheads. Below are my table structures: create_table payheads,
From the regular aspnet_Users table I have created two sub-tables with one to one
I am newbie in SQL.I am reading Triggers created two trigger on a table.Below
Below I have two tables users and users_profiles Both are innoDB and collation: utf8_general_ci

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.