suitable connection method

ll1-2690 80 Reputation points


I need to consolidate the company's employees. I now have three tables, each with a unique EmpID, through which I want to concatenate the three tables.

tableA contains basic information about individuals, names, etc.

tableB contains contact information, etc., and some are empty.

tableC contains simple family relationships, some are empty.

Please recommend a suitable connection method.

Thanks in advance.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
9,786 questions
{count} votes

Accepted answer
  1. PercyTang-MSFT 5,541 Reputation points Microsoft Vendor

    Hi @ll1-2690

    According to your description, you can use the left outer join, like this.

    select * from tableA as A left outer join tableB as B on A.EmpID = B.EmpID
    	                      left outer join tableC as C on A.EmpID = C.EmpID;

    Best regards,

    Percy Tang

    If the answer is the right solution, please click "Accept Answer". If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful