summaryrefslogtreecommitdiff
path: root/mysql-test/r/ndb_minmax.result
blob: cc0c238ac6eedb71371ac12be5b41eb1295c36ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
drop table if exists t1, t2;
CREATE TABLE t1 (
a int PRIMARY KEY
) engine = ndb;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
INSERT INTO t1 VALUES (6);
select MAX(a) from t1;
MAX(a)
6
select MAX(a) from t1;
MAX(a)
6
select MAX(a) from t1;
MAX(a)
6
select MAX(a) from t1;
MAX(a)
6
select MIN(a) from t1;
MIN(a)
1
select MIN(a) from t1;
MIN(a)
1
select MIN(a) from t1;
MIN(a)
1
select * from t1 order by a;
a
1
2
3
4
5
6
select MIN(a) from t1;
MIN(a)
1
select MAX(a) from t1;
MAX(a)
6
select MAX(a) from t1;
MAX(a)
6
select * from t1 order by a;
a
1
2
3
4
5
6
drop table t1;
CREATE TABLE t2 (
a int PRIMARY KEY,
b int not null,
c int not null,
KEY(b),
UNIQUE(c)
) engine = ndb;
INSERT INTO t2 VALUES (1, 5, 1);
INSERT INTO t2 VALUES (2, 2, 7);
INSERT INTO t2 VALUES (3, 3, 3);
INSERT INTO t2 VALUES (4, 4, 4);
INSERT INTO t2 VALUES (5, 5, 5);
INSERT INTO t2 VALUES (6, 6, 6);
INSERT INTO t2 VALUES (7, 2, 10);
INSERT INTO t2 VALUES (8, 10, 2);
select MAX(a) from t2;
MAX(a)
8
select MAX(b) from t2;
MAX(b)
10
select MAX(c) from t2;
MAX(c)
10
select MIN(a) from t2;
MIN(a)
1
select MIN(b) from t2;
MIN(b)
2
select MIN(c) from t2;
MIN(c)
1
select * from t2 order by a;
a	b	c
1	5	1
2	2	7
3	3	3
4	4	4
5	5	5
6	6	6
7	2	10
8	10	2
select MIN(b) from t2;
MIN(b)
2
select MAX(a) from t2;
MAX(a)
8
select MAX(c) from t2;
MAX(c)
10
select * from t2 order by a;
a	b	c
1	5	1
2	2	7
3	3	3
4	4	4
5	5	5
6	6	6
7	2	10
8	10	2
drop table t2;