title: Counting word occurrence with SQL query
body: <p>I have two tables. </p>
  
  <p>Table1:</p>
  
  <pre><code>ID   SENTENCE
  1    The shoes are good shoes.
  2    There is a tree.
  3    This is nice, nice, nice!
  </code></pre>
  
  <p>Table2:</p>
  
  <pre><code>ID   WORD
  1    The
  1    shoes
  1    are
  1    good
  1    shoes
  2    There
  2    is
  2    a
  2    tree
  3    This
  3    is
  3    nice
  3    nice
  3    nice
  </code></pre>
  
  <p>I need to count the occurrence of each word in every sentence from Table1. If any word occurs more than once (>1), then count it else skip it. In the end the resulting table should look like this:</p>
  
  <pre><code>ID   SENTENCE                   CNT
  1    The shoes are good shoes.  2
  2    There is a tree.
  3    This is nice, nice, nice!  3
  </code></pre>