|
参考自带的 用户操作统计,截取的sql语句如下(数据库用 sql server 2005)
SELECT t.* FROM ( select a.userid, count(*) ct, sum(case when right(logcontent, 4) in ('登录成功', 'cess')
then 1 else 0 end) login_count from t_s_log a where operatetime >= (CONVERT(VARCHAR,'2018-05-01') as
DATETIME) AND operatetime <= (CONVERT(VARCHAR,'2018-05-25') as DATETIME) group by a.userid )
t order by ct desc
|
|