WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GROUP BY s.student_id ) as emps' at line 18]
SELECT SUM(if(positive_ct>0,1,0)) as positive_ct, SUM(if(negative_ct>0,1,0)) as negative_ct, SUM(if(no_change_ct>0,1,0)) as no_change_ct FROM ( SELECT s.student_id, sum(if(q.answer_after>q.answer_before,1,0)) as positive_ct, sum(if(q.answer_after<q.answer_before,1,0)) as negative_ct, sum(if(q.answer_after=q.answer_before,1,0)) as no_change_ct FROM ey3_stru u JOIN ey3_surveys s ON u.user = s.student_id JOIN ey3_survey_questions q ON q.survey_id = s.id WHERE q.question_type IN ('M') AND u.user != u.parent_user AND s.training_id = GROUP BY s.student_id ) as emps

WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 10]
SELECT DISTINCT w.id, REPLACE(w.display_name,'''','') as employee_name FROM ey3_stru u JOIN ey3_surveys s ON u.user = s.user_id JOIN ey3_survey_questions q ON q.survey_id = s.id JOIN wp_users w ON w.id = u.user WHERE 1=1 AND u.user != u.parent_user AND s.training_id =