title: How can I join on null?
body: <p>Here is my table structure:</p>
  
  <pre><code>-- qanda (stands for questions and answers)
  +----+---------+-----------------------------------------------+--------------+
  | id |  title  |                      content                  |  question_id |
  +----+---------+-----------------------------------------------+--------------+
  | 1  | title1  | this is a question                            | NULL         |
  | 2  | NULL    | this is an answer                             | 1            |
  | 3  | NULL    | this is another answer                        | 1            |
  | 4  | title2  | this is another question                      | NULL         |
  | 5  | NULL    | this is an answer for the second question     | 4            |
  | 6  | NULL    | this is another answer for the first question | 1            |
  +----+---------+-----------------------------------------------+--------------+
  </code></pre>
  
  <p>I know, it would be much better if I keep the questions and answers in two different tables. But now I'm just trying to understand how exactly <code>JOIN</code> works in this case. </p>
  
  <hr>
  
  <p>I have an id of <code>qanda</code> table and I always want a title. That id might be either the id of a question or the id of an answer. How can I do that?</p>
  
  <hr>
  
  <p>I want something like this:</p>
  
  <pre><code>SELECT t1.title
  FROM qanda t1
  INNER JOIN qanda t2
  ON t1.id = t2.question_id
  WHERE t1.id = :id
  </code></pre>
  
  <p>My query matches nothing. And here are some samples of the expected results:</p>
  
  <pre><code>-- :id = 1
  +--------+
  | title1 |
  +--------+
  
  -- :id = 2
  +--------+
  | title1 |
  +--------+
  
  -- :id = 4
  +--------+
  | title2 |
  +--------+
  
  -- :id = 5
  +--------+
  | title2 |
  +--------+
  
  -- :id = 6
  +--------+
  | title1 |
  +--------+
  </code></pre>