Sign in
apache
/
drill-test-framework
/
9a5d7ecf7f32f0e95c0ea874e75d785fdee9e51d
/
.
/
framework
/
resources
/
Functional
/
aggregates
/
aggregation
/
group_by_expression
/
sum_on_c_integer_in_case.sql
blob: 7c7abcd87e9a4f20af4350f56df522a6e5196649 [
file
] [
log
] [
blame
]
select
c_boolean
,
(
CASE
when
(
c_boolean
is
null
)
then
ROUND
(
SUM
(
c_integer
/
12
))
else
CAST
(
SUM
(
CASE
when
(
c_smalldecimal
is
null
)
then
0
else
c_smalldecimal
*
1.2
end
)
as
bigint
)
end
)
from
alltypes
group
by
c_boolean
order
by
c_boolean
;