title: Update column with id value of current row in SQL Server
body: <p>I need to set a query like below:</p>
  
  <pre><code>UPDATE A
      SET Column = (CASE WHEN (Select COUNT(*) from A, B
                               where A.Id = B.Id ) &gt; 0 THEN 1
                         WHEN (Select COUNT(*) from A, B
                               where A.Id = B.bId ) &gt; 10 THEN 2
                    END)
  </code></pre>
  
  <p>I need to do this with id value of current row in table. But I don't know how to get this value.
  This code </p>
  
  <pre><code>SELECT COUNT(*) FROM A, B
  WHERE A.Id = B.Id 
  </code></pre>
  
  <p>returns result for all rows, but I need a result for current row.</p>
  
  <p>I use SQL Server</p>