答案 0 :(得分:0)
您是否尝试过EXISTS
功能?
SELECT DISTINCT questionset
FROM table_name tab1
WHERE (NOT EXISTS (SELECT 1
FROM table_name tab2
WHERE tab1.questionset = tab2.questionset
AND tab1.question = tab2.question
AND tab1.answer = tab2.answer
AND tab1.user_id <> tab2.user_id )
OR NOT EXISTS (SELECT 1
FROM table_name tab3
WHERE tab1.questionset = tab3.questionset
AND tab1.question = tab3.question
AND tab1.user_id <> tab3.user_id )) ;