条件をon句に移動するだけanswers.username = 'mikha'
で、その時点で冗長なwhere条件を削除することもできます。
SELECT questions.id, answers.username
FROM questions
LEFT JOIN answers ON(questions.id = answers.id AND answers.username = 'mikha')
WHERE questions.target_username = 'every.one'
GROUP BY questions.id, answers.username;
編集:これが要件であるかどうかはわかりませんが、まだ誰も回答していない質問を省略したい場合は、次のようにします。
SELECT questions.id, answers.username
FROM questions
LEFT JOIN answers ON(questions.id = answers.id AND answers.username = 'mikha')
LEFT JOIN answers others ON(questions.id = others.id AND others.username <> 'mikha')
WHERE questions.target_username = 'every.one'
AND (
(
answers.id IS NOT NULL
AND others.id IS NULL
)
OR (
answers.id IS NULL
AND others.id IS NOT NULL
)
)
GROUP BY questions.id, answers.username;
編集2:テストテーブルにあるものとクエリ#2の結果は次のとおりです。
SELECT * FROM questions;
+----+-----------------+
| id | target_username |
+----+-----------------+
| 1 | every.one |
| 2 | every.one |
| 3 | every.one |
| 4 | every.one |
+----+-----------------+
4 rows in set (0.00 sec)
SELECT * FROM answers;
+-----+----+----------+
| ida | id | username |
+-----+----+----------+
| 1 | 1 | guy |
| 2 | 1 | maricela |
| 3 | 2 | mikha |
+-----+----+----------+
3 rows in set (0.00 sec)
(Run query #2 above)
+----+----------+
| id | username |
+----+----------+
| 1 | NULL |
| 2 | mikha |
+----+----------+
2 rows in set (0.00 sec)
編集3:コメントで追加した基準に準拠する更新されたテーブルデータと更新されたクエリは次のとおりです。
SELECT * FROM questions;
+----+-----------------+
| id | target_username |
+----+-----------------+
| 1 | every.one |
| 2 | every.one |
| 3 | every.one |
| 4 | every.one |
+----+-----------------+
4 rows in set (0.00 sec)
SELECT * FROM answers;
+-----+----+----------+
| ida | id | username |
+-----+----+----------+
| 1 | 1 | guy |
| 2 | 1 | maricela |
| 3 | 2 | mikha |
| 7 | 4 | guy |
| 8 | 4 | mikha |
+-----+----+----------+
5 rows in set (0.00 sec)
新しいクエリ:
SELECT questions.id, answers.username
FROM questions
LEFT JOIN answers ON(questions.id = answers.id AND answers.username = 'mikha')
LEFT JOIN answers others ON(questions.id = others.id AND others.username <> 'mikha')
WHERE questions.target_username = 'every.one'
AND (
answers.username = 'mikha'
OR (
answers.id IS NULL
AND others.id IS NOT NULL
)
)
GROUP BY questions.id, answers.username;
結果:
+----+----------+
| id | username |
+----+----------+
| 1 | NULL |
| 2 | mikha |
| 4 | mikha |
+----+----------+
3 rows in set (0.00 sec)