select sum ( t.val ) from
(
select count(distinct(da1.studentno)) as val from dcs_attendance da1 group by FROM_UNIXTIME(da1.inserttime,'%Y%m%d')
) t
至于你还要做其他的,得看其他的数据关系了,现有的信息没法做。
select sum(score) from table where id in (0,1,4) union all select sum(score) from table where id in (2,3,5)这样处理即可
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)