IG
Size: a a a
IG
IG
WITH
3 AS a,
0 AS b
SELECT a / nullIf(b, 0)
Query id: 9bc4bb40-236f-413d-8313-4d5fcbfe9bb3
┌─divide(a, nullIf(b, 0))─┐
│ ᴺᵁᴸᴸ │
└─────────────────────────┘
DT
IG
PV
DS
DS
RK
DS
DS
IG
OG
RN
AK
M
DT
AK
DT
OG
SC
SELECT
count(*) AS cnt,
toStartOfInterval(time, toIntervalDay(1)) AS period
FROM metrics
WHERE (toDate(time) >= '2021-01-11') AND (toDate(time) <= '2021-01-12')
GROUP BY period
ORDER BY period ASC
UNION ALL
SELECT
0 AS cnt,
arrayJoin(timeSlots(toDateTime(toDate('2021-01-11'), 'UTC'), toUInt32(dateDiff('second', toDateTime(toDate('2021-01-11')), toDateTime(toDate('2021-01-12')))), toUInt32(86400))) AS period
GROUP BY period
ORDER BY period ASC
┌────cnt─┬──────────────period─┐
│ 391722 │ 2021-01-11 00:00:00 │
│ 468620 │ 2021-01-12 00:00:00 │
└────────┴─────────────────────┘
┌─cnt─┬──────────────period─┐
│ 0 │ 2021-01-11 03:00:00 │
│ 0 │ 2021-01-12 03:00:00 │
└─────┴─────────────────────┘
SELECT timeSlots(toDateTime(toDate('2021-01-11'), 'UTC'), toUInt32(dateDiff('second', toDateTime(toDate('2021-01-11')), toDateTime(toDate('2021-01-12')))), toUInt32(86400)) AS slots
┌─slots─────────────────────────────────────────┐
│ ['2021-01-11 00:00:00','2021-01-12 00:00:00'] │
└───────────────────────────────────────────────┘