title: Search in two tables and order by occurrence of term
body: <p>I have this query to search in two SQL tables. I am looking for a way to sort the result by occurrence. This is my query:</p>
  
  <pre><code>SELECT `parent_id`
  FROM wp_forum_posts
  WHERE text LIKE '%{$term1}%'
  UNION
  SELECT `id`
  FROM wp_forum_threads
  WHERE subject LIKE '%{$term1}%
  </code></pre>
  
  <p>Which is the best way, to get the results ordered?</p>