title: select with update sql server?
body: <pre><code>Alter Proc K_RT_BranchWiseBirdsStock
  @branch varchar(50)
  
  as
  begin
  
  select  ROW_NUMBER() OVER(ORDER BY a.branch) as sno,b.sno as keys,
  d.branch,a.transferbirds,b.noofbirds,c.noofbirds,e.mortality,
  (a.transferbirds-b.noofbirds-c.noofbirds-e.mortality) as finalbirds from    
  K_RT_RetailsDetails a 
  inner join K_RT_WarehouseDetails b on a.branch = b.branch
  inner join K_RT_MasterBirdsTransferDet c on a.branch = c.frombranch 
  inner join K_RT_MasterRetailStores d on d.sno = a.branch
  inner join K_RT_DailyEntry e on e.branch = d.sno
  where d.branch = @branch
  
  update K_RT_RetailsDetails set transferbirds = finalbirds where branch = @branch
  end
  </code></pre>
  
  <p>here i want to fill the column transferbirds = finalbirds...here finalbirds is a alias name.how can i update that column..please help me</p>