ms sql left join select
snippet in sql

ms sql left join select

user3349

SELECT * FROM 
(SELECT [column] FROM [table]) a
LEFT JOIN (SELECT [column1], [columnn2] FROM [table]) b
ON a.column = b.column1

ms sql left join select

user2164

SELECT * FROM 
(SELECT [UserID] FROM [User]) a
LEFT JOIN (SELECT [TailUser], [Weight] FROM [Edge] WHERE [HeadUser] = 5043) b
ON a.UserId = b.TailUser