title: Trying to combine select & Update
body: <p>I have a select statement where i get some records based upon a condition </p>
  
  <pre><code>UPDATE A
  SET A.Status = 3
  from dbo.Table A
  JOIN (Select fkID, count(1) as total
          from dbo.TableLogs A
          Group by fkID
          having count(1) &gt; 10) B
    on B.fkID = A.id
  Where A.status = 2
  
  select status,id,filename from table 
  where status not in (1,3)
  </code></pre>
  
  <p>i want to merge those both queries in one single statement that if the files which had total count of more than 10, update status to 3 and continue filtering files to get only those files which has status of neither <code>1</code> or <code>3</code></p>