Objective: To find the hits received by hour of day
Here is the code I’m running:
SELECT hour ( convert_tz(created_at, '+00:00','+05:30') ) AS hour_extract , count(*) AS hit_count FROM hits WHERE date(created_at) > (CURDATE() - INTERVAL 360 DAY) GROUP BY 1 ORDER BY 1 ASC;
So basically I’m grouping all hits received by “created_at” - which is a date/time field.
Example: 2017-12-07 12:03:32
But the result of the same query is different when I run it on my server (with Workbench/DBviz.) as compared to metabase.
Have a look here:
And it’s not like I’ll find the value 801 (from cell B2) anywhere in column C. The values just don’t match up.
Any idea why this is the case?
I would have thought that a query in metabase is the same as running it on my Mysql server.