Hi @Mike
select A.TName,A.Code,A.PerID,
case when A.City = B.City then '' else A.City end as City_A,
case when A.City = B.City then '' else B.City end as City_B,
case when A.Post = B.Post then '' else A.Post end as Post_A,
case when A.Post = B.Post then '' else B.Post end as Post_B,
case when A.[Add] = B.[Add] then '' else A.[Add] end as Add_A,
case when A.[Add] = B.[Add] then '' else B.[Add] end as Add_B
from TableA as A inner join TableB as B on A.TName = B.TName
Output:
Best regards, Percy Tang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. 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.