title: Sql Server Issue During Update
body: <p>Hello I am little bit confused to see the sql server behaviour on executing the query. According to mine the output should be "Priyanka" ,4 </p>
  
  <pre><code>Declare @temp table(
  Name Varchar(50),
  amount int
  )
  
  insert @temp values ('Priyanka' ,10 )
  
  Update @temp
  set amount=amount-A.a
  from (
  select  'Priyanka' as Name,1 as a 
  union
  select  'Priyanka' as Name,5 as a
  )A
  where [@temp].Name in (A.Name)
  
  select * from @temp
  </code></pre>
  
  <p>But
  the output </p>
  
  <pre><code>Name    amount
  Priyanka    9
  </code></pre>
  
  <p>Can any one Please tell me why this is happened.</p>