Nested CTE With Full Join
Nested CTE With Full Join
SELECT t1.UserID, t2.UserID, t2.TypeID, t2.Remark, UserID = ISNULL(t1.UserID, t2.UserID), t2. Name
FROM [dbo].[t1] t1
ON t1.UserID = t2.UserID;
OR
FROM [dbo].[t1] t1
ON t1.UserID = t2.UserID;
-- Left Join
SELECT t1.UserID, t2.UserID, t2.TypeID, t2.Remark, UserID = ISNULL(t1.UserID, t2.UserID), t2. Name
FROM [dbo].[t1] t1
ON t1.UserID = t2.UserID;
as
up as --cte 2
on t1.UserID = cmp.UserID)
--where t1.UserID IS NULL)
Select * from up
([UserID])
Select * from up