ClickHouse/tests/queries/0_stateless/02459_group_by_all.sql

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

16 lines
499 B
MySQL
Raw Normal View History

2022-10-12 16:50:56 +00:00
DROP TABLE IF EXISTS group_by_all;
CREATE TABLE group_by_all
(
2022-10-20 10:03:00 +00:00
a String,
b int
2022-10-12 16:50:56 +00:00
)
engine = Memory;
2022-10-20 10:03:00 +00:00
insert into group_by_all values ('abc1', 0), ('abc2', 0), ('abc3', 0), ('abc4', 0);
2022-10-12 16:50:56 +00:00
2022-10-20 10:03:00 +00:00
select a, count(b) from group_by_all group by all;
select substring(a, 1, 3), count(b) from group_by_all group by all;
select substring(a, 1, 3), substring(substring(a, 1, 2), 1, count(b)) from group_by_all group by all;
select substring(a, 1, 3), substring(a, 1, count(b)) from group_by_all group by all;