title: subqueries in UPDATE SET (sql server 2005)
body: <p>I have a question about using subqueries in an Update statement.  My example: </p>
  
  <pre><code>UPDATE TRIPS
     SET locations = city + ', ' FROM (select Distinct city 
                                         from poi 
                                        where poi.trip_guid = trips.guid) 
  </code></pre>
  
  <p>Is it possible to refer to main table value (trips.guid) in subqueries?  </p>
  
  <p>When i try to use <code>trips.guid</code> I get the error:</p>
  
  <blockquote>
    <p>"The multi-part identifier "trips.guid" could not be bound."</p>
  </blockquote>
  
  <p>The clause 'select Distinct city from poi' return more that one city. </p>