title: SQL Server: update column with select result
body: <p>I have table Student with a column called IdStudent. 
  The value of IdStudent is 0</p>
  
  <p>Table Student also have a column called UID</p>
  
  <p>I need to update  IdStudent in table Student with  IdCandidate in table Candidate.</p>
  
  <p>Table Candidate also have UID column containing the same UID of table Student. </p>
  
  <p>So we can do this to have IdCandidate: </p>
  
  <pre><code> select C.IdCandidate from Candidate as C inner join Student as S
   on C.UID = S.UID
  </code></pre>
  
  <p>How can I update IdStudent in table Student with this IdCandidate obtained in this select? </p>
  
  <p>Thanks! </p>