title: Update based on a select statement SQL Server 2005
body: <p>I have a select statement that gives me the results I need for my update but I have no idea how to incorporate it into the update. Below is the select statement and the results.</p>
  
  <pre><code>select top 20 percent
  fpartno
  ,(fytdiss * fmatlcost) as 'total'
  from inmast
  where fpartno not like 'CRV%'
  and fcstscode = 'A'
  group by fpartno, fytdiss,fmatlcost,fabccode
  order by total desc
  
  fpartno                         total
  ---------------------------------------------------
  1062-20-0244                172821.4800000000
  B50602                      91600.7205800000
  BM6031PQ                    82978.3200000000
  LY2F-DC12                   74740.9500000000
  BM6033SQ                    51640.4200000000
  DTM06-6S-E007               49810.4700000000
  </code></pre>
  
  <p>My update looks like this</p>
  
  <pre><code>update inmast
  set fabccode = 'A'
  </code></pre>
  
  <p>I'm guessing my select would some how go into the where clause but I'm not sure how.</p>