You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ClickHouse client version 1.1.54030.
Connecting to localhost:9000.
Connected to ClickHouse server version 1.1.54030.
:) select toDate('1967-01-01')
SELECT toDate('1967-01-01')
┌─toDate('1967-01-01')─┐
│ 0000-00-00 │
└────────────────────────┘
Alexey, thank you for answer! It sad restrictions.
Please tell me the best way to store birthdate user? May be date split by 3 columns: year, month and day? And say please how best way for grouping users by age and period 0 - 20, 20 - 40 years old?
select
sumIf(cnt, age between 0and13) as yo_13, /*от 0 до 13*/
sumIf(cnt, age between 14and17) as yo_17, /*от 14 до 17*/
sumIf(cnt, age between 18and24) as yo_24, /*от 18 до 24*/
sumIf(cnt, age between 25and29) as yo_29, /*от 25 до 29*/
sumIf(cnt, age between 30and44) as yo_44, /*от 30 до 44*/
sumIf(cnt, age between 45and54) as yo_54, /*от 45 до 54*/
sumIf(cnt, age between 55and85) as yo_85, /*от 55 до 85*/
sumIf(cnt, age >85) as yo_more /*от 85 и более*/from (
select toYear(today()) - year_of_birth - ((toMonth(today()) - month_of_birth <0) or (toMonth(today()) - month_of_birth ==0and toDayOfMonth(today()) - day_of_birth <0) ? 1 : 0) as age, sum(cnt) as cnt from (
select year_of_birth, month_of_birth, day_of_birth, count() as cnt from TABLE group by year_of_birth, month_of_birth, day_of_birth
) group by age
) FORMAT Vertical
Do you plan to supporting date functions for dates before 1970 for birth dates, ... and other historic dates. Can you explain the philosohy behind the decision (if not time and resources)?
Activity
alexey-milovidov commentedon Nov 2, 2016
Only dates after the beginning of the unix epoch are supported. As documented here:
https://clickhouse.yandex/reference_en.html#Date
You could use different data type (String or UInt32) to store broader range of dates,
but datetime functions will not work with them.
sichkarev commentedon Nov 3, 2016
Alexey, thank you for answer! It sad restrictions.
Please tell me the best way to store birthdate user? May be date split by 3 columns: year, month and day? And say please how best way for grouping users by age and period 0 - 20, 20 - 40 years old?
Thank you so much!
sichkarev commentedon Nov 8, 2016
I did it :)
@alexey-milovidov may be you think best way for task?
alexey-milovidov commentedon Nov 12, 2016
I have no better solution. I wanted to propose the same.
yehiaelbehery commentedon Feb 21, 2020
Do you plan to supporting date functions for dates before 1970 for birth dates, ... and other historic dates. Can you explain the philosohy behind the decision (if not time and resources)?
den-crane commentedon Feb 21, 2020
@yehiaelbehery yes. It will be implemented in DateTime64 #7316
Merge pull request ClickHouse#158 from arthurpassosorg/customizations…
[ClickHouse#154][ClickHouse#158] increase timeout and modify parse su…
Merge branch 'increase_timeout_and_modify_parse_summary' into 'dev-22'