Masz dwie opcje
INNER JOIN x
ON x.qid = y.qid OR (x.qid IS NULL AND y.qid IS NULL)
lub łatwiej
INNER JOIN x
ON x.qid IS NOT DISTINCT FROM y.qid
Masz dwie opcje
INNER JOIN x
ON x.qid = y.qid OR (x.qid IS NULL AND y.qid IS NULL)
lub łatwiej
INNER JOIN x
ON x.qid IS NOT DISTINCT FROM y.qid