现有两张表
inner jion -内连接(完全匹配)
SELECT * FROM dbo.UserInfo u INNER JOIN dbo.Student s on u.StudentID=s.StudentName
left jion 左连接(以左表为准,如果右表匹配不到则会赋值为空)
SELECT * FROM dbo.UserInfo u LEFT JOIN dbo.Student s ON u.StudentID=s.StudentName
right jion 右连接(和left jion相反,以右表为准,如果左边记录不存在,则赋值为空)
SELECT * FROM dbo.UserInfo u right JOIN dbo.Student s ON u.StudentID=s.StudentName