Máte dvě možnosti
INNER JOIN x
ON x.qid = y.qid OR (x.qid IS NULL AND y.qid IS NULL)
nebo jednodušší
INNER JOIN x
ON x.qid IS NOT DISTINCT FROM y.qid
Máte dvě možnosti
INNER JOIN x
ON x.qid = y.qid OR (x.qid IS NULL AND y.qid IS NULL)
nebo jednodušší
INNER JOIN x
ON x.qid IS NOT DISTINCT FROM y.qid