title: Subquery returned more than 1 value. Count and Update Query
body: <blockquote>
  <p>Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &lt;, &lt;= , &gt;, &gt;= or when the subquery is used as an expression.</p>
  </blockquote>
  <p>This is my query. Primary Key is ID. FISID is not primary key.</p>
  <pre class="lang-sql prettyprint-override"><code>UPDATE table1
  SET QUANTITY = (
     SELECT COUNT(*) 
     FROM table2 AS L 
     INNER JOIN table1 AS K ON K.ID=L.table1ID AND K.FISID=L.FISID 
     group by K.FISID
  )
  </code></pre>
  <p>I have an two table on SQL Server. I want to count the relevant rows in the table2 table and write the number in the QUANTITY field.</p>
  <p>This is my subquery result;</p>
  <pre class="lang-none prettyprint-override"><code>|table2 Count |
  | ----------- |
  |      1      |
  |      1      |
  |      4      |
  |      2      |
  |      5      |
  --------------------
  </code></pre>