ClickHouse/tests/queries/0_stateless/01646_rewrite_sum_if.reference

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
473 B
Plaintext
Raw Normal View History

0
0 0 1
0
50
50 50 1
50
50
50 50 50 1 0
50
50
50 50 50 1 0
50
2022-12-30 07:43:54 +00:00
SELECT sumIf(123, (number % 2) = 0)
FROM numbers(100)
SELECT sum(if((number % 2) = 0, 123, 0))
FROM numbers(100)
SELECT sum(if((number % 2) = 0, 0, 123))
FROM numbers(100)
0
0 0 1
0
50
50 50 1
50
50
50 50 50 1 0
50
50
50 50 50 1 0
50
2022-12-30 07:43:54 +00:00
SELECT 123 * countIf((number % 2) = 0)
FROM numbers(100)
SELECT 123 * countIf((number % 2) = 0)
FROM numbers(100)
SELECT 123 * countIf(NOT ((number % 2) = 0))
FROM numbers(100)