oceanbase

Форк
0
/r
/
aggr_bug200109.result 
27 строк · 1.1 Кб
1
drop table if exists t1;
2
create table t1 (id int primary key, n1 int, n2 int, s varchar(20), vs varchar(20), t varchar(256));
3
insert into t1 values (0, NULL, NULL, 'zero', 'zero', 'zero'), (1,1,11, 'one','eleven', 'eleven'),  (2,1,11, 'one','eleven', 'eleven'),  (3,2,11, 'two','eleven', 'eleven'),  (4,2,12, 'two','twevle', 'twelve'),  (5,2,13, 'two','thirteen', 'foo'),  (6,2,13, 'two','thirteen', 'foo'),  (7,2,13, 'two','thirteen', 'bar'),  (8,NULL,13, 'two','thirteen', 'bar'),  (9,2,NULL, 'two','thirteen', 'bar'),  (10,2,13, NULL,'thirteen', 'bar'),  (11,2,13, 'two',NULL, 'bar'),  (12,2,13, 'two','thirteen', NULL);
4
select n1, n2 from t1;
5
n1	n2
6
NULL	NULL
7
1	11
8
1	11
9
2	11
10
2	12
11
2	13
12
2	13
13
2	13
14
NULL	13
15
2	NULL
16
2	13
17
2	13
18
2	13
19
select count(distinct n1), count(distinct n2) from t1;
20
count(distinct n1)	count(distinct n2)
21
2	3
22
select count(n1), count(distinct n1), count(n2), count(distinct n2) from t1;
23
count(n1)	count(distinct n1)	count(n2)	count(distinct n2)
24
11	2	11	3
25
select count(distinct n1), count(distinct n2), count(n1), count(n2) from t1;
26
count(distinct n1)	count(distinct n2)	count(n1)	count(n2)
27
2	3	11	11
28

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.