题解 | #今天的刷题量(一)#
今天的刷题量(一)
http://www.nowcoder.com/practice/e18f56796ae94c3d885e61c8d57a950e
思路:用now()求出现在时间,再用date_format转换时间
select name,cnt from (select subject_id,create_time,count(*) cnt from submission group by subject_id,create_time) s1 left join subject s2 on s1.subject_id=s2.id where create_time=date_format(now(),'%Y-%m-%d') order by cnt desc,subject_id