将sql查询转换为条件api

时间:2016-11-28 18:31:14

标签: mysql

如何用条件api

编写这个sql查询

SELECT matricule,sum(presence_badge_minutes),SUM(presence_theorique_minutes),(SELECT SUM(presence_badge_minutes)来自于t2其中({{ {1}} BETWEEN' 2016-5-20' 2016-6-2')和(date_effett2 = matriculet1)))作为pb1,(SELECT SUM(matricule)来自presence_theorique_minutes,其中({t2 BETWEEN' 2016-5-20&#39 ;和' 2016-6-2')和(date_effett2 = matriculet1)))作为pt1,(SELECT SUM( matricule){} {} {} { (presence_badge_minutest2 = date_effett2)))作为pb2,(SELECT SUM(matricule)来自t1的存在(其中) (matricule BETWEEN' 2016-6-15'和' 2016-6-20')和(presence_theorique_minutest2 = {{1 } {。{1}})))作为date_effet的pt2作为t2matricule

0 个答案:

没有答案