select B.realname, case A.subject when 'GS001' then '语文' when 'GS002' then '数学' when 'GS003' then '物理' when 'GS004' then '化学' when 'GS005' then '政治' when 'GS006' then '历史' when 'GS007' then '地理' when 'GS008' then '生物' when 'GS009' then '英语' when 'GS010' then '日语' when 'GS016' then '示例' when 'GS017' then '思想品德' when 'GS018' then '信息技术' end, A.costtime, A.date from task_cost_time AS A LEFT JOIN student AS B ON A.studentId=B.id where A.studentId in(select id from student where classId=457) and (A.date='2017-01-03 00:00:00' or A.date='2017-01-04 00:00:00' or A.date='2017-01-05 00:00:00');
转载于:https://www.cnblogs.com/zl0372/p/6230853.html