ClickHouse/dbms/tests/queries/1_stateful/00052_group_by_in.sql
2018-08-07 20:08:51 +03:00

5 lines
190 B
SQL

select StartDate, TraficSourceID in (0) ? 'type_in' : 'other' as traf_type, sum(Sign)
from test.visits
where CounterID = 160656
group by StartDate, traf_type ORDER BY StartDate, traf_type