title: Update query with subquery
body: <p>Does this abstracted SQL query solution? I need to update rows using a subquery with <code>where</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/kjefK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kjefK.jpg" alt="Screenshot of query"></a></p>
  
  <pre><code>UPDATE articles
  SET varcount = (
      SELECT
          COUNT(*)
      FROM
          articles
      WHERE
          parentid = articles.id
  )
  WHERE
      articles.parentid = '';
  </code></pre>