title: select if word beginning with but not exist in other table
body: <p>I need to get from <code>phrase_table</code> all rows where <code>phrase</code> column contains words beginning with <code>be</code> (in this example) but exclude if the entire word exist in <code>stop_words_table</code> and NOT EXCLUDE if one word exist in <code>stop_words_table</code> but another not exist (see id=4 <code>be</code> and <code>because</code>)</p>
  
  <pre><code>phrase_table
  id  phrase
  1     would be fine
  2     nothing to do
  3     belgium is beautiful
  4     this also must be included because I need
  </code></pre>
  
  <p>.   </p>
  
  <pre><code>stopwords_table
  id    word
  1       be
  </code></pre>
  
  <p>.</p>
  
  <p>I have tried this:</p>
  
  <pre><code>SELECT id FROM phrase_table
  WHERE phrase REGEXP '[[:&lt;:]]be' = 1
  -- That return id 1,3,4
  
  SELECT id FROM phrase_table
  WHERE phrase REGEXP '[[:&lt;:]]be' = 1
  AND phrase NOT IN(
      SELECT * FROM stopwords_table WHERE word = 'be'
  )
  -- That return nothing because 'be' exists in stopwords_table
  </code></pre>
  
  <p><strong>ESPECTED RESULT</strong>:</p>
  
  <p><code>id 3 and 4 from phrase_table</code></p>