title: Update table if join table does not have rows
body: <p>I have two tables which has relationships and I trying to update base table if there are no records in the child table.</p>
  
  <p>Table1:</p>
  
  <pre><code>id value
  1  abc
  2  xyz
  </code></pre>
  
  <p>Table2:</p>
  
  <pre><code>id table1_id
  1  1
  2  1
  </code></pre>
  
  <p>So in this case I want to update table1 id 2 to <code>pqr</code> as it does not have associated rows in table2. For id 1 nothing happens.</p>
  
  <p>I tried this way but this is completely wrong </p>
  
  <pre><code>update table1  set value = 'pqr'
      from table1 t1 inner join table2 t2 on count(t2.table1_id) &lt; 1
  </code></pre>