Tuesday, December 20, 2016

Get total question consumed

SELECT * FROM 
(
Select
 d.student_id as d_student_id,
  d.gold as d_gold,
  d.total_question_consume as   d_total_question_consume,
  d.total_question_correct as d_total_question_correct
from osem_main.usr_student_data_main d 
/*WHERE d.student_id not in (4,5,22,47,49,55,79,84,85,2001,2002,2007,2021) */
) as md
join
(
SELECT c.student_id as c_student_id, count(*) as c_total_consume, sum(c.final_result) as c_total_correct 
from osem_content.qst_student_consumption c 
/*where c.student_id not in (4,5,22,47,49,55,79,84,85,2001,2002,2007,2021)*/
group by c.student_id
) as cd
ON md.d_student_id = cd.c_student_id
;

update osem_main.usr_student_main set is_reviewer=1 where login_id
in
('syazwi','awieer','quzaimer2016','hanania',
'alisa613','kindaichi',
'nazshahsalim','ainanie19','imran3087','kkkkkkkk','nazuhan87',
'osmanawang','azimazahar3','mustafakamal','aliffhafiy',
'imran3086','dinsiputsedut','ismahadi',
'abubakar','hahahaha','aqib21',
'nazshah','reez26','aqib20','langbuana','imran3088','imran3089',
'aqib21','amalina','reezh26','lalala', 'ajilala','aqib1234', 'ejoy12',
'azimazahar3','sabrina88',
 'hanania',
 'dinsiputsedut',
 'imran3086',
  'ainanie19',
 'juhari',
 'osmanawang',
 'imranhamzah','jijiji','susususu',
'Otobot','juhari','joejoejoe','radzeen','jjjjjj','alifdanishazmi');

select group_concat(student_id) from osem_main.usr_student_main m where m.is_reviewer=1;

No comments:

Post a Comment