title: SQL group by subselect
body: <p>I have the following query:</p>
  
  <pre><code>select title_id, shared_task_id from tasks_task order by title_id
  </code></pre>
  
  <p>The results are like so:</p>
  
  <pre><code>title_id    shared_task_id
  1           99217
  1           NULL
  4           18873
  4           18874
  4           18875
  4           NULL
  4           NULL
  4           NULL
  </code></pre>
  
  <p>I want to find all <code>shared_task_id</code>s that have more than one <code>title_id</code>.</p>
  
  <p>Here would be an example. Using the below data:</p>
  
  <pre><code>title_id       shared_task_id
  1              100
  2              100
  3              105
  3              NULL
  4              110
  5              NULL
  6              120
  6              120
  6              120
  </code></pre>
  
  <p>The query would return:</p>
  
  <pre><code>title_id       shared_task_id
  1              100
  2              100
  </code></pre>
  
  <p>Because this is the only entry with the same shared_task_id with a different title. What would be the correct query here?</p>