I have two select statements that work correctly. They are as
SELECT DISTINCT user.* FROM user_tab AS user INNER JOIN user_pref_tab
AS pref ON user.id=pref.userid and pref.questionid = '20'
SELECT DISTINCT user.* FROM user_tab AS user LEFT JOIN user_pref_tab
AS pref ON user.id=pref.userid WHERE pref.userid IS NULL
The first simply returns all rows that have the same userid in the
user and preferences table that also have the column "questionid" as a
value of 20.
The second just returns every row that doesn't have a matching userid
in both tables.
The problem is I desperately need to combine ...