SQL Inner Join On Null Values
You have two options
INNER JOIN x ON x.qid = y.qid OR (x.qid IS NULL AND y.qid IS NULL)
or easier
INNER JOIN x ON x.qid IS NOT DISTINCT FROM y.qid
This article has a good discussion on this issue. You can use
SELECT * FROM YINNER JOIN X ON EXISTS(SELECT X.QID INTERSECT SELECT y.QID);
Are you committed to using the Inner join syntax?
If not you could use this alternative syntax:
SELECT * FROM Y,XWHERE (X.QID=Y.QID) or (X.QUID is null and Y.QUID is null)