第一题: select record_date, sum(case when result='win&(13547)#39; then 1 else 0 end) win, sum(case when result='fail&(13559)#39; then 1 else 0 end) fail from winfail group by record_date 第二题: select t.t_name name, sum(a.price) cost from teacher t inner join (select b.b_id, b.b_price price, s.t_id from book b inner join schedule s on b.b_id = s.b_id) a on t.t_id = a.t_id where t.t_title = 'lecturer&(13560)#39; group by t.t_id; 全AC