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 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355
|
use test;
SELECT * FROM t_10;
a b
1 One
3 Three
5 Five
9 Nine
SELECT * FROM t_100;
a b
11 Eleven
13 Thirdteen
15 Fifeteen
19 Nineteen
91 Ninety-one
93 Ninety-three
95 Ninety-five
99 Ninety-nine
SELECT * FROM t_1000;
a b
111 Hundred elven
113 Hundred thirdteen
115 Hundred fiveteen
119 Hundred nineteen
131 Hundred thirty-one
133 Hundred thirty-three
135 Hundred thirty-five
139 Hundred thirty-nine
151 Hundred fifty-one
153 Hundred fifty-three
155 Hundred fity-five
159 Hundred fifty-nine
191 Hundred ninety-one
193 Hundred ninety-three
195 Hundred ninety-five
199 Hundred ninety-nine
SELECT * FROM tp;
a b
112 Hundred twelve
114 Hundred fourteen
116 Hundred sixteen
118 Hundred eightteen
12 twelve
122 Hundred twenty-two
124 Hundred twenty-four
126 Hundred twenty-six
128 Hundred twenty-eight
14 Fourteen
16 Sixteen
162 Hundred sixty-two
164 Hundred sixty-four
166 Hundred sixty-six
168 Hundred sixty-eight
18 Eightteen
182 Hundred eighty-two
184 Hundred eighty-four
186 Hundred eighty-six
188 Hundred eighty-eight
2 Two
4 Four
6 Six
8 Eight
SELECT * FROM tsp;
a b
112 Hundred twelve
114 Hundred fourteen
116 Hundred sixteen
118 Hundred eightteen
12 twelve
122 Hundred twenty-two
124 Hundred twenty-four
126 Hundred twenty-six
128 Hundred twenty-eight
14 Fourteen
16 Sixteen
162 Hundred sixty-two
164 Hundred sixty-four
166 Hundred sixty-six
168 Hundred sixty-eight
18 Eightteen
182 Hundred eight-two
184 Hundred eighty-four
186 Hundred eighty-six
188 Hundred eighty-eight
2 Two
4 Four
6 Six
8 Eight
SELECT * FROM tsp_00;
a b
5 Five
SELECT * FROM tsp_01;
a b
1 One
SELECT * FROM tsp_02;
a b
SELECT * FROM tsp_03;
a b
3 Three
SELECT * FROM tsp_04;
a b
9 Nine
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
SELECT * FROM t_10;
a b
2 Two
4 Four
6 Six
8 Eight
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
a b
1 One
3 Three
5 Five
9 Nine
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
SELECT * FROM t_10;
a b
1 One
3 Three
5 Five
9 Nine
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
a b
2 Two
4 Four
6 Six
8 Eight
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_empty;
SELECT * FROM t_empty;
a b
2 Two
4 Four
6 Six
8 Eight
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
a b
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_empty;
SELECT * FROM t_empty;
a b
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
a b
2 Two
4 Four
6 Six
8 Eight
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_null;
SELECT * FROM t_null;
a b
2 Two
4 Four
6 Six
8 Eight
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
a b
1 NULL
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_null;
SELECT * FROM t_null;
a b
1 NULL
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
a b
2 Two
4 Four
6 Six
8 Eight
ALTER TABLE tp EXCHANGE PARTITION p1 WITH TABLE t_100;
SELECT * FROM t_100;
a b
12 twelve
14 Fourteen
16 Sixteen
18 Eightteen
SELECT * FROM tp WHERE a BETWEEN 10 AND 100;
a b
11 Eleven
13 Thirdteen
15 Fifeteen
19 Nineteen
91 Ninety-one
93 Ninety-three
95 Ninety-five
99 Ninety-nine
ALTER TABLE tp EXCHANGE PARTITION p1 WITH TABLE t_100;
SELECT * FROM t_100;
a b
11 Eleven
13 Thirdteen
15 Fifeteen
19 Nineteen
91 Ninety-one
93 Ninety-three
95 Ninety-five
99 Ninety-nine
SELECT * FROM tp WHERE a BETWEEN 10 AND 100;
a b
12 twelve
14 Fourteen
16 Sixteen
18 Eightteen
ALTER TABLE tp EXCHANGE PARTITION p2 WITH TABLE t_1000;
SELECT * FROM t_1000;
a b
112 Hundred twelve
114 Hundred fourteen
116 Hundred sixteen
118 Hundred eightteen
122 Hundred twenty-two
124 Hundred twenty-four
126 Hundred twenty-six
128 Hundred twenty-eight
162 Hundred sixty-two
164 Hundred sixty-four
166 Hundred sixty-six
168 Hundred sixty-eight
182 Hundred eighty-two
184 Hundred eighty-four
186 Hundred eighty-six
188 Hundred eighty-eight
SELECT * FROM tp WHERE a BETWEEN 100 AND 1000;
a b
111 Hundred elven
113 Hundred thirdteen
115 Hundred fiveteen
119 Hundred nineteen
131 Hundred thirty-one
133 Hundred thirty-three
135 Hundred thirty-five
139 Hundred thirty-nine
151 Hundred fifty-one
153 Hundred fifty-three
155 Hundred fity-five
159 Hundred fifty-nine
191 Hundred ninety-one
193 Hundred ninety-three
195 Hundred ninety-five
199 Hundred ninety-nine
ALTER TABLE tp EXCHANGE PARTITION p2 WITH TABLE t_1000;
SELECT * FROM t_1000;
a b
111 Hundred elven
113 Hundred thirdteen
115 Hundred fiveteen
119 Hundred nineteen
131 Hundred thirty-one
133 Hundred thirty-three
135 Hundred thirty-five
139 Hundred thirty-nine
151 Hundred fifty-one
153 Hundred fifty-three
155 Hundred fity-five
159 Hundred fifty-nine
191 Hundred ninety-one
193 Hundred ninety-three
195 Hundred ninety-five
199 Hundred ninety-nine
SELECT * FROM tp WHERE a BETWEEN 100 AND 1000;
a b
112 Hundred twelve
114 Hundred fourteen
116 Hundred sixteen
118 Hundred eightteen
122 Hundred twenty-two
124 Hundred twenty-four
126 Hundred twenty-six
128 Hundred twenty-eight
162 Hundred sixty-two
164 Hundred sixty-four
166 Hundred sixty-six
168 Hundred sixty-eight
182 Hundred eighty-two
184 Hundred eighty-four
186 Hundred eighty-six
188 Hundred eighty-eight
ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
ALTER TABLE tsp EXCHANGE PARTITION sp01 WITH TABLE tsp_01;
ALTER TABLE tsp EXCHANGE PARTITION sp02 WITH TABLE tsp_02;
ALTER TABLE tsp EXCHANGE PARTITION sp03 WITH TABLE tsp_03;
ALTER TABLE tsp EXCHANGE PARTITION sp04 WITH TABLE tsp_04;
SELECT * FROM tsp_00;
a b
SELECT * FROM tsp_01;
a b
6 Six
SELECT * FROM tsp_02;
a b
2 Two
SELECT * FROM tsp_03;
a b
8 Eight
SELECT * FROM tsp_04;
a b
4 Four
SELECT * FROM tsp WHERE a BETWEEN 0 AND 10;
a b
1 One
3 Three
5 Five
9 Nine
ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
ALTER TABLE tsp EXCHANGE PARTITION sp01 WITH TABLE tsp_01;
ALTER TABLE tsp EXCHANGE PARTITION sp02 WITH TABLE tsp_02;
ALTER TABLE tsp EXCHANGE PARTITION sp03 WITH TABLE tsp_03;
ALTER TABLE tsp EXCHANGE PARTITION sp04 WITH TABLE tsp_04;
SELECT * FROM tsp_00;
a b
5 Five
SELECT * FROM tsp_01;
a b
1 One
SELECT * FROM tsp_02;
a b
SELECT * FROM tsp_03;
a b
3 Three
SELECT * FROM tsp_04;
a b
9 Nine
SELECT * FROM tsp WHERE a BETWEEN 0 AND 10;
a b
2 Two
4 Four
6 Six
8 Eight
ALTER TABLE tsp EXCHANGE PARTITION sp01 WITH TABLE t_null;
SELECT * FROM t_null;
a b
6 Six
SELECT * FROM tsp WHERE a BETWEEN 0 AND 10;
a b
1 NULL
2 Two
4 Four
8 Eight
ALTER TABLE tsp EXCHANGE PARTITION sp01 WITH TABLE t_null;
SELECT * FROM t_null;
a b
1 NULL
SELECT * FROM tsp WHERE a BETWEEN 0 AND 10;
a b
2 Two
4 Four
6 Six
8 Eight
DROP TABLE IF EXISTS t_10;
DROP TABLE IF EXISTS t_100;
DROP TABLE IF EXISTS t_1000;
DROP TABLE IF EXISTS tp;
DROP TABLE IF EXISTS tsp;
DROP TABLE IF EXISTS tsp_00;
DROP TABLE IF EXISTS tsp_01;
DROP TABLE IF EXISTS tsp_02;
DROP TABLE IF EXISTS tsp_03;
DROP TABLE IF EXISTS tsp_04;
DROP TABLE IF EXISTS t_empty;
DROP TABLE IF EXISTS t_null;
|