I have a table where I want to retreive data every hourly from database in report format. like
username 8-9 9-10 10-11
====================================
kiran 20 27 33
Ram 25 23 44
Can we get like this in mysql please help.
select username,count(message) as '8-9' from customer_1.audit_trail
inner join inteliviz.users
on customer_1.audit_trail.user_id = inteliviz.users.id inner join
customer_1.carparks on customer_1.carparks.id = customer_1.audit_trail.location_id
where datetime>'2013-08-27 08:00:00' and datetime<'2013-08-27 09:00:00'
group by username limit 1000;