Home > Database > Mysql Tutorial > OSC 内部员工在网站上的活跃统计(考核)

OSC 内部员工在网站上的活跃统计(考核)

WBOY
Release: 2016-06-07 14:57:10
Original
1617 people have browsed it

该SQL用于每月统计所有OSC员工在OSChina网站上的活跃天数,作为每月的考核指标之一。 OSCHINA SELECT u.NAME, extract(YEAR_MONTH FROM create_time) ym, COUNT(DISTINCT DAY(create_time)) `count` FROM osc_opt_logs o, osc_users u WHERE o. USER = u.id A

该 SQL 用于每月统计所有 OSC 员工在 OSChina 网站上的活跃天数,作为每月的考核指标之一。 OSCHINA
SELECT u.NAME, extract(YEAR_MONTH FROM create_time) ym, COUNT(DISTINCT DAY(create_time)) `count` 
FROM osc_opt_logs o, osc_users u WHERE o. USER = u.id 
AND u.id IN ( xxx , xxx, xxx, xxx, xxx) 
AND ( DATE_SUB(CURDATE(), INTERVAL 1 MONTH) <= o.create_time ) 
GROUP BY USER, ym ORDER BY ym DESC, `count` desc;
Copy after login
OSC 内部员工在网站上的活跃统计(考核)
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template