【发布时间】:2018-01-12 10:40:25
【问题描述】:
我有一个表 Student,其中有一列名为 IdStudent。 IdStudent 的值为 0
学生表也有一个名为 UID 的列
我需要用表 Candidate 中的 IdCandidate 更新表 Student 中的 IdStudent。
Table Candidate 也有 UID 列,其中包含与表 Student 相同的 UID。
所以我们可以这样做来拥有IdCandidate:
select C.IdCandidate from Candidate as C inner join Student as S
on C.UID = S.UID
如何使用在此选择中获得的 IdCandidate 更新表 Student 中的 IdStudent?
谢谢!
【问题讨论】:
标签: sql sql-server select sql-update inner-join