1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: explicit milliseconds precision of timestamp columns

This commit is contained in:
Ferdinand Mütsch
2022-03-18 13:41:32 +01:00
parent a3acdc7041
commit 91b4cb2c13
6 changed files with 64 additions and 8 deletions

View File

@ -1,11 +1,8 @@
SELECT s2.user_id, sum(c) as count, total, (sum(c) / total) as ratio
FROM (
SELECT time,
user_id,
entity,
COUNT(time) as c
SELECT time, user_id, entity, is_write, branch, editor, machine, operating_system, COUNT(time) as c
FROM heartbeats
GROUP BY time, user_id, entity
GROUP BY time, user_id, entity, is_write, branch, editor, machine, operating_system
HAVING COUNT(time) > 1
) s2
LEFT JOIN (SELECT user_id, count(id) AS total FROM heartbeats GROUP BY user_id) s3 ON s2.user_id = s3.user_id