SQL 时间截按月分组查询
选将时间截转换成日期格式,再执行分组查询按月分组,查高询每月的记录总数,Yii用法$art_summary = Yii::app()->db->createCommand() ->select('DATE_FORMAT(FROM_UNIXTIME(inputtime),"%Y-%m") as month, COUNT(art_id) as num') ...