i have m_peserta table.
no_test | name
-----------------------
11 | Mr. X
21 | Mr. Y
31 | Mr. Z
41 | Mr. P
I have result table
no_test | quest_cat | answer
-------------------------------------------
11 | Type I-2 | 1
11 | Type I-5 | 1
11 | Type I-6 | 1
11 | Type II-2 | My Answer is bla
11 | Type II-4 | My Answer is bla
21 | Type I-5 | 1
21 | Type I-6 | 1
21 | Type II-3 | My Answer is bla
21 | Type II-1 | *note : this is a Null Answer
21 | Type III-1| *note : this is a Null Answer
21 | Type III-3| My Answer is bla
and i have a empty table named combine_table with the column is no_test, name, count_quest_I, count_quest_II, count_quest_III.
And i need query "INSERT" from combine table m_peserta and result, so i have a combine_table like this
no_test | name | count_quest_I | count_quest_II | count_quest_III
-----------------------------------------------------
11 | Mr. X | 3 | 2 | 0
21 | Mr. Y | 2 | 1 | 1
please help, thank you