我必须根据日期时间每小时从数据库中获取数据,我尝试过但无法理解..我是 sql 新手,你能帮帮我吗?我正在尝试在一小时内获取特定用户的数据,他执行了多少操作
select username,count(message) as '8-9',count(message) as '9-10',count(message) as '10-11'
from customer_1.audit_trail
inner join inteliviz.user on customer_1.audit_trail.user_id = inteliviz.users.id
where datetime>'2013-08-21 08:00:00' and datetime<'2013-08-21 09:00:00'
group by username limit 1000;