I have 3 tables. ID and Name is the primary key for the first table.
First Table
ID | Name | Date ---------------- 1 | AA | 11/02 2 | BB | 04/10
ID, Name and Option are the primary key for second table:
Second Table
ID | Name | Option | SeqNo --------------------------- 3 | DD | LOVE | 1 4 | EE | SINGLE | 1
Option is the primary key for the third table:
Third Table
Option | Status --------------- LOVE | Y MARRIED| Y SINGLE | N
After I join these tables, I will get like this.
ID | Name | Option | SeqNo | Status ------------------------------------ 1 | AA | NULL | NULL | NULL 2 | BB | NULL | NULL | NULL 3 | CC | LOVE | 1 | Y 4 | DD | SINGLE | 1 | N
My question is, how to change the NULL value to a value contain in another table?
As an example, The Option column must be filled in with the value inside the third table. I'm using SQL Server 2005