目前我统计登录次数是用的SQL SELECT DATE_FORMAT(a.loginTime,'%Y-%c-%d') logindate,COUNT(a.username) FROM g_user_login_log a GROUP BY logindate ORDER BY a.loginTime 用户数好像要group by userid了,这样就涉及到转向,比较麻烦。。有没有比较简洁的统计语句。。
------解决方案--------------------
select DATE_FORMAT(a.loginTime,'%Y-%c-%d') logindate,COUNT(distinct a.username) as totalUser,count(*) as 登录次数 from g_user_login_log a GROUP BY logindate ORDER BY a.loginTime
------解决方案--------------------