CU
Не совсем понимаю как в этом случае использовать numbers.
Size: a a a
CU
DB
S
CU
DC
SELECT
id,
arrayJoin(arrayMap(i -> (toStartOfMonth(b) + toIntervalMonth(i)), range(toUInt64(toYYYYMM(e) - toYYYYMM(b))))) AS m
FROM
(
SELECT
1 AS id,
toDate('2021-01-01') AS b,
toDate('2021-06-01') AS e
)
┌─id─┬──────────m─┐
│ 1 │ 2021-01-01 │
│ 1 │ 2021-02-01 │
│ 1 │ 2021-03-01 │
│ 1 │ 2021-04-01 │
│ 1 │ 2021-05-01 │
└────┴────────────┘
CU
DC
toUInt64 ( ) надо cast( a - b, 'UInt64' )CU
S
CU
CU
CU
select
agreement_id,
arrayJoin(arrayMap(i -> (toStartOfMonth(start_date) + toIntervalMonth(i)), range(12))) AS m
CU
arrayJoin(arrayMap(i -> (toStartOfMonth(start_date) + toIntervalMonth(i)), range(CAST(dateDiff('month', start_date, end_date),'UInt64')))) AS mA call to function range overflows, investigate the values of arguments you are passing: while executing 'FUNCTION range(CAST(dateDiff('month', start_date, end_date), 'UInt64') :: 2) -> range(CAST(dateDiff('month', start_date, end_date), 'UInt64')) Array(UInt64) : 5' (version 21.6.5.37 (official build))CU
S
S
CZ
S
dateDiff('second',end_date, start_date) <= 86400*7CZ
I