mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 10:31:57 +00:00
Fix roundAge()
This commit is contained in:
parent
9e1db557e0
commit
38e89b892a
@ -15,8 +15,7 @@ struct RoundAgeImpl
|
|||||||
|
|
||||||
static inline ResultType apply(A x)
|
static inline ResultType apply(A x)
|
||||||
{
|
{
|
||||||
return x < 1 ? 0
|
return (x < 18 ? 0
|
||||||
: (x < 18 ? 17
|
|
||||||
: (x < 25 ? 18
|
: (x < 25 ? 18
|
||||||
: (x < 35 ? 25
|
: (x < 35 ? 25
|
||||||
: (x < 45 ? 35
|
: (x < 45 ? 35
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
SELECT roundAge(0);
|
SELECT roundAge(0);
|
||||||
|
SELECT roundAge(12);
|
||||||
SELECT roundAge(18);
|
SELECT roundAge(18);
|
||||||
SELECT roundAge(25);
|
SELECT roundAge(25);
|
||||||
SELECT roundAge(35);
|
SELECT roundAge(35);
|
||||||
SELECT roundAge(45);
|
SELECT roundAge(45);
|
||||||
SELECT roundAge(55);
|
SELECT roundAge(55);
|
||||||
SELECT roundAge(56);
|
SELECT roundAge(56);
|
||||||
|
Loading…
Reference in New Issue
Block a user