The essence is as follows: There is a table
id id_abitur quest answer 1 20170001 exam 9 2 20170001 exam 10 3 20170001 exam 17 8 20170002 exam 9 9 20170002 exam 10 10 20170002 exam 14 11 20170002 exam 17 16 20170003 exam 9 17 20170003 exam 10 18 20170003 exam 14 19 20170003 exam 17 24 20170004 exam 9 25 20170004 exam 10
id_abitur I need a sample id_abitur , in which quest = 'exam' and answer only 9,10,17 making a request
SELECT `id_abitur`, COUNT (` id`) AS c FROM meta_abitur WHERE `quest` = 'exam' AND` answer` IN (9,10,17) GROUP BY ʻid_abitur` HAVING c = 3
They are displayed id 9,10,17 as well as in which 9,10,17,19, i.e. those that have another line. What am I doing wrong and how to fix it?