~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/pool_of_threads.result

  • Committer: Monty Taylor
  • Date: 2008-08-04 19:37:18 UTC
  • mto: (261.2.2 codestyle)
  • mto: This revision was merged to the branch mainline in revision 262.
  • Revision ID: monty@inaugust.com-20080804193718-f0rz13uli4429ozb
Changed gettext_noop() to N_()

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
drop table if exists t1,t2,t3,t4;
2
 
CREATE TABLE t1 (
3
 
Period int DEFAULT '0000' NOT NULL,
4
 
Varor_period int DEFAULT '0' NOT NULL
5
 
) ENGINE=myisam;
6
 
INSERT INTO t1 VALUES (9410,9412);
7
 
select period from t1;
8
 
period
9
 
9410
10
 
select * from t1;
11
 
Period  Varor_period
12
 
9410    9412
13
 
select t1.* from t1;
14
 
Period  Varor_period
15
 
9410    9412
16
 
CREATE TABLE t2 (
17
 
auto int not null auto_increment,
18
 
fld1 int DEFAULT '000000' NOT NULL,
19
 
companynr int DEFAULT '00' NOT NULL,
20
 
fld3 char(30) DEFAULT '' NOT NULL,
21
 
fld4 char(35) DEFAULT '' NOT NULL,
22
 
fld5 char(35) DEFAULT '' NOT NULL,
23
 
fld6 char(4) DEFAULT '' NOT NULL,
24
 
UNIQUE fld1 (fld1),
25
 
KEY fld3 (fld3),
26
 
PRIMARY KEY (auto)
27
 
) ENGINE=myisam;
28
 
select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
29
 
fld3
30
 
imaginable
31
 
select fld3 from t2 where fld3 like "%cultivation" ;
32
 
fld3
33
 
cultivation
34
 
select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;
35
 
fld3    companynr
36
 
concoct 58
37
 
druggists       58
38
 
engrossing      58
39
 
Eurydice        58
40
 
exclaimers      58
41
 
ferociousness   58
42
 
hopelessness    58
43
 
Huey    58
44
 
imaginable      58
45
 
judges  58
46
 
merging 58
47
 
ostrich 58
48
 
peering 58
49
 
Phelps  58
50
 
presumes        58
51
 
Ruth    58
52
 
sentences       58
53
 
Shylock 58
54
 
straggled       58
55
 
synergy 58
56
 
thanking        58
57
 
tying   58
58
 
unlocks 58
59
 
select fld3,companynr from t2 where companynr = 58 order by fld3;
60
 
fld3    companynr
61
 
concoct 58
62
 
druggists       58
63
 
engrossing      58
64
 
Eurydice        58
65
 
exclaimers      58
66
 
ferociousness   58
67
 
hopelessness    58
68
 
Huey    58
69
 
imaginable      58
70
 
judges  58
71
 
merging 58
72
 
ostrich 58
73
 
peering 58
74
 
Phelps  58
75
 
presumes        58
76
 
Ruth    58
77
 
sentences       58
78
 
Shylock 58
79
 
straggled       58
80
 
synergy 58
81
 
thanking        58
82
 
tying   58
83
 
unlocks 58
84
 
select fld3 from t2 order by fld3 desc limit 10;
85
 
fld3
86
 
youthfulness
87
 
yelped
88
 
Wotan
89
 
workers
90
 
Witt
91
 
witchcraft
92
 
Winsett
93
 
Willy
94
 
willed
95
 
wildcats
96
 
select fld3 from t2 order by fld3 desc limit 5;
97
 
fld3
98
 
youthfulness
99
 
yelped
100
 
Wotan
101
 
workers
102
 
Witt
103
 
select fld3 from t2 order by fld3 desc limit 5,5;
104
 
fld3
105
 
witchcraft
106
 
Winsett
107
 
Willy
108
 
willed
109
 
wildcats
110
 
select t2.fld3 from t2 where fld3 = 'honeysuckle';
111
 
fld3
112
 
honeysuckle
113
 
select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';
114
 
fld3
115
 
honeysuckle
116
 
select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';
117
 
fld3
118
 
honeysuckle
119
 
select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';
120
 
fld3
121
 
honeysuckle
122
 
select t2.fld3 from t2 where fld3 LIKE 'h%le';
123
 
fld3
124
 
honeysuckle
125
 
select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';
126
 
fld3
127
 
select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';
128
 
fld3
129
 
explain select t2.fld3 from t2 where fld3 = 'honeysuckle';
130
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
131
 
1       SIMPLE  t2      ref     fld3    fld3    122     const   1       Using where; Using index
132
 
explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle';
133
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
134
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    Using where
135
 
explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle';
136
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
137
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    Using where
138
 
explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle';
139
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
140
 
1       SIMPLE  t2      ref     fld3    fld3    122     const   1       Using where; Using index
141
 
explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
142
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
143
 
1       SIMPLE  t2      ref     fld3    fld3    122     const   1       Using where; Using index
144
 
explain select fld3 from t2 ignore index (fld3,not_used);
145
 
ERROR 42000: Key 'not_used' doesn't exist in table 't2'
146
 
explain select fld3 from t2 use index (not_used);
147
 
ERROR 42000: Key 'not_used' doesn't exist in table 't2'
148
 
select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
149
 
fld3
150
 
honeysuckle
151
 
honoring
152
 
explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
153
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
154
 
1       SIMPLE  t2      range   fld3    fld3    122     NULL    2       Using where; Using index
155
 
select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
156
 
fld1    fld3
157
 
148504  Colombo
158
 
68305   Colombo
159
 
0       nondecreasing
160
 
select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes';
161
 
fld1    fld3
162
 
232605  appendixes
163
 
1232605 appendixes
164
 
1232606 appendixes
165
 
1232607 appendixes
166
 
1232608 appendixes
167
 
1232609 appendixes
168
 
select fld1 from t2 where fld1=250501 or fld1="250502";
169
 
fld1
170
 
250501
171
 
250502
172
 
explain select fld1 from t2 where fld1=250501 or fld1="250502";
173
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
174
 
1       SIMPLE  t2      range   fld1    fld1    4       NULL    2       Using where; Using index
175
 
select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
176
 
fld1
177
 
250501
178
 
250502
179
 
250505
180
 
250601
181
 
explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
182
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
183
 
1       SIMPLE  t2      range   fld1    fld1    4       NULL    4       Using where; Using index
184
 
select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%';
185
 
fld1    fld3
186
 
12001   flanking
187
 
13602   foldout
188
 
13606   fingerings
189
 
18007   fanatic
190
 
18017   featherweight
191
 
18054   fetters
192
 
18103   flint
193
 
18104   flopping
194
 
36002   funereal
195
 
38017   fetched
196
 
38205   firearm
197
 
58004   Fenton
198
 
88303   feminine
199
 
186002  freakish
200
 
188007  flurried
201
 
188505  fitting
202
 
198006  furthermore
203
 
202301  Fitzpatrick
204
 
208101  fiftieth
205
 
208113  freest
206
 
218008  finishers
207
 
218022  feed
208
 
218401  faithful
209
 
226205  foothill
210
 
226209  furnishings
211
 
228306  forthcoming
212
 
228311  fated
213
 
231315  freezes
214
 
232102  forgivably
215
 
238007  filial
216
 
238008  fixedly
217
 
select fld3 from t2 where fld3 like "L%" and fld3 = "ok";
218
 
fld3
219
 
select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly");
220
 
fld3
221
 
Chantilly
222
 
select fld1,fld3 from t2 where fld1 like "25050%";
223
 
fld1    fld3
224
 
250501  poisoning
225
 
250502  Iraqis
226
 
250503  heaving
227
 
250504  population
228
 
250505  bomb
229
 
select fld1,fld3 from t2 where fld1 like "25050_";
230
 
fld1    fld3
231
 
250501  poisoning
232
 
250502  Iraqis
233
 
250503  heaving
234
 
250504  population
235
 
250505  bomb
236
 
select distinct companynr from t2;
237
 
companynr
238
 
0
239
 
37
240
 
36
241
 
50
242
 
58
243
 
29
244
 
40
245
 
53
246
 
65
247
 
41
248
 
34
249
 
68
250
 
select distinct companynr from t2 order by companynr;
251
 
companynr
252
 
0
253
 
29
254
 
34
255
 
36
256
 
37
257
 
40
258
 
41
259
 
50
260
 
53
261
 
58
262
 
65
263
 
68
264
 
select distinct companynr from t2 order by companynr desc;
265
 
companynr
266
 
68
267
 
65
268
 
58
269
 
53
270
 
50
271
 
41
272
 
40
273
 
37
274
 
36
275
 
34
276
 
29
277
 
0
278
 
select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%";
279
 
fld3    period
280
 
obliterates     9410
281
 
offload 9410
282
 
opaquely        9410
283
 
organizer       9410
284
 
overestimating  9410
285
 
overlay 9410
286
 
select distinct fld3 from t2 where companynr = 34 order by fld3;
287
 
fld3
288
 
absentee
289
 
accessed
290
 
ahead
291
 
alphabetic
292
 
Asiaticizations
293
 
attitude
294
 
aye
295
 
bankruptcies
296
 
belays
297
 
Blythe
298
 
bomb
299
 
boulevard
300
 
bulldozes
301
 
cannot
302
 
caressing
303
 
charcoal
304
 
checksumming
305
 
chess
306
 
clubroom
307
 
colorful
308
 
cosy
309
 
creator
310
 
crying
311
 
Darius
312
 
diffusing
313
 
duality
314
 
Eiffel
315
 
Epiphany
316
 
Ernestine
317
 
explorers
318
 
exterminated
319
 
famine
320
 
forked
321
 
Gershwins
322
 
heaving
323
 
Hodges
324
 
Iraqis
325
 
Italianization
326
 
Lagos
327
 
landslide
328
 
libretto
329
 
Majorca
330
 
mastering
331
 
narrowed
332
 
occurred
333
 
offerers
334
 
Palestine
335
 
Peruvianizes
336
 
pharmaceutic
337
 
poisoning
338
 
population
339
 
Pygmalion
340
 
rats
341
 
realest
342
 
recording
343
 
regimented
344
 
retransmitting
345
 
reviver
346
 
rouses
347
 
scars
348
 
sicker
349
 
sleepwalk
350
 
stopped
351
 
sugars
352
 
translatable
353
 
uncles
354
 
unexpected
355
 
uprisings
356
 
versatility
357
 
vest
358
 
select distinct fld3 from t2 limit 10;
359
 
fld3
360
 
abates
361
 
abiding
362
 
Abraham
363
 
abrogating
364
 
absentee
365
 
abut
366
 
accessed
367
 
accruing
368
 
accumulating
369
 
accuracies
370
 
select distinct fld3 from t2 having fld3 like "A%" limit 10;
371
 
fld3
372
 
abates
373
 
abiding
374
 
Abraham
375
 
abrogating
376
 
absentee
377
 
abut
378
 
accessed
379
 
accruing
380
 
accumulating
381
 
accuracies
382
 
select distinct substring(fld3,1,3) from t2 where fld3 like "A%";
383
 
substring(fld3,1,3)
384
 
aba
385
 
abi
386
 
Abr
387
 
abs
388
 
abu
389
 
acc
390
 
acq
391
 
acu
392
 
Ade
393
 
adj
394
 
Adl
395
 
adm
396
 
Ado
397
 
ads
398
 
adv
399
 
aer
400
 
aff
401
 
afi
402
 
afl
403
 
afo
404
 
agi
405
 
ahe
406
 
aim
407
 
air
408
 
Ald
409
 
alg
410
 
ali
411
 
all
412
 
alp
413
 
alr
414
 
ama
415
 
ame
416
 
amm
417
 
ana
418
 
and
419
 
ane
420
 
Ang
421
 
ani
422
 
Ann
423
 
Ant
424
 
api
425
 
app
426
 
aqu
427
 
Ara
428
 
arc
429
 
Arm
430
 
arr
431
 
Art
432
 
Asi
433
 
ask
434
 
asp
435
 
ass
436
 
ast
437
 
att
438
 
aud
439
 
Aug
440
 
aut
441
 
ave
442
 
avo
443
 
awe
444
 
aye
445
 
Azt
446
 
select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10;
447
 
a
448
 
aba
449
 
abi
450
 
Abr
451
 
abs
452
 
abu
453
 
acc
454
 
acq
455
 
acu
456
 
Ade
457
 
adj
458
 
select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10;
459
 
substring(fld3,1,3)
460
 
aba
461
 
abi
462
 
Abr
463
 
abs
464
 
abu
465
 
acc
466
 
acq
467
 
acu
468
 
Ade
469
 
adj
470
 
select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10;
471
 
a
472
 
aba
473
 
abi
474
 
Abr
475
 
abs
476
 
abu
477
 
acc
478
 
acq
479
 
acu
480
 
Ade
481
 
adj
482
 
create table t3 (
483
 
period    int not null,
484
 
name      char(32) not null,
485
 
companynr int not null,
486
 
price     double(11,0),
487
 
price2     double(11,0),
488
 
key (period),
489
 
key (name)
490
 
) engine=myisam;
491
 
create temporary table tmp engine = myisam select * from t3;
492
 
insert into t3 select * from tmp;
493
 
insert into tmp select * from t3;
494
 
insert into t3 select * from tmp;
495
 
insert into tmp select * from t3;
496
 
insert into t3 select * from tmp;
497
 
insert into tmp select * from t3;
498
 
insert into t3 select * from tmp;
499
 
insert into tmp select * from t3;
500
 
insert into t3 select * from tmp;
501
 
insert into tmp select * from t3;
502
 
insert into t3 select * from tmp;
503
 
insert into tmp select * from t3;
504
 
insert into t3 select * from tmp;
505
 
insert into tmp select * from t3;
506
 
insert into t3 select * from tmp;
507
 
insert into tmp select * from t3;
508
 
insert into t3 select * from tmp;
509
 
alter table t3 add t2nr int not null auto_increment primary key first;
510
 
drop table tmp;
511
 
select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10;
512
 
namn
513
 
Abraham Abraham
514
 
abrogating abrogating
515
 
admonishing admonishing
516
 
Adolph Adolph
517
 
afield afield
518
 
aging aging
519
 
ammonium ammonium
520
 
analyzable analyzable
521
 
animals animals
522
 
animized animized
523
 
select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10;
524
 
concat(fld3," ",fld3)
525
 
Abraham Abraham
526
 
abrogating abrogating
527
 
admonishing admonishing
528
 
Adolph Adolph
529
 
afield afield
530
 
aging aging
531
 
ammonium ammonium
532
 
analyzable analyzable
533
 
animals animals
534
 
animized animized
535
 
select distinct fld5 from t2 limit 10;
536
 
fld5
537
 
neat
538
 
Steinberg
539
 
jarring
540
 
tinily
541
 
balled
542
 
persist
543
 
attainments
544
 
fanatic
545
 
measures
546
 
rightfulness
547
 
select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
548
 
fld3    count(*)
549
 
affixed 1
550
 
and     1
551
 
annoyers        1
552
 
Anthony 1
553
 
assayed 1
554
 
assurers        1
555
 
attendants      1
556
 
bedlam  1
557
 
bedpost 1
558
 
boasted 1
559
 
select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
560
 
fld3    count(*)
561
 
affixed 1
562
 
and     1
563
 
annoyers        1
564
 
Anthony 1
565
 
assayed 1
566
 
assurers        1
567
 
attendants      1
568
 
bedlam  1
569
 
bedpost 1
570
 
boasted 1
571
 
select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10;
572
 
fld3    repeat("a",length(fld3))        count(*)
573
 
circus  aaaaaa  1
574
 
cited   aaaaa   1
575
 
Colombo aaaaaaa 1
576
 
congresswoman   aaaaaaaaaaaaa   1
577
 
contrition      aaaaaaaaaa      1
578
 
corny   aaaaa   1
579
 
cultivation     aaaaaaaaaaa     1
580
 
definiteness    aaaaaaaaaaaa    1
581
 
demultiplex     aaaaaaaaaaa     1
582
 
disappointing   aaaaaaaaaaaaa   1
583
 
select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2;
584
 
companynr       rtrim(space(512+companynr))
585
 
37      
586
 
78      
587
 
101     
588
 
154     
589
 
311     
590
 
447     
591
 
512     
592
 
select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3;
593
 
fld3
594
 
explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3;
595
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
596
 
1       SIMPLE  t2      ALL     fld1    NULL    NULL    NULL    1199    Using where; Using temporary; Using filesort
597
 
1       SIMPLE  t3      eq_ref  PRIMARY PRIMARY 4       test.t2.fld1    1       Using index
598
 
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
599
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
600
 
1       SIMPLE  t1      ALL     period  NULL    NULL    NULL    41810   Using temporary; Using filesort
601
 
1       SIMPLE  t3      ref     period  period  4       test.t1.period  4181    
602
 
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
603
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
604
 
1       SIMPLE  t3      index   period  period  4       NULL    1       
605
 
1       SIMPLE  t1      ref     period  period  4       test.t3.period  4181    
606
 
explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
607
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
608
 
1       SIMPLE  t1      index   period  period  4       NULL    1       
609
 
1       SIMPLE  t3      ref     period  period  4       test.t1.period  4181    
610
 
select period from t1;
611
 
period
612
 
9410
613
 
select period from t1 where period=1900;
614
 
period
615
 
select fld3,period from t1,t2 where fld1 = 011401 order by period;
616
 
fld3    period
617
 
breaking        9410
618
 
select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001;
619
 
fld3    period
620
 
breaking        1001
621
 
explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period;
622
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
623
 
1       SIMPLE  t2      const   fld1    fld1    4       const   1       
624
 
1       SIMPLE  t3      const   PRIMARY,period  PRIMARY 4       const   1       
625
 
select fld3,period from t2,t1 where companynr*10 = 37*10;
626
 
fld3    period
627
 
breaking        9410
628
 
Romans  9410
629
 
intercepted     9410
630
 
bewilderingly   9410
631
 
astound 9410
632
 
admonishing     9410
633
 
sumac   9410
634
 
flanking        9410
635
 
combed  9410
636
 
subjective      9410
637
 
scatterbrain    9410
638
 
Eulerian        9410
639
 
Kane    9410
640
 
overlay 9410
641
 
perturb 9410
642
 
goblins 9410
643
 
annihilates     9410
644
 
Wotan   9410
645
 
snatching       9410
646
 
concludes       9410
647
 
laterally       9410
648
 
yelped  9410
649
 
grazing 9410
650
 
Baird   9410
651
 
celery  9410
652
 
misunderstander 9410
653
 
handgun 9410
654
 
foldout 9410
655
 
mystic  9410
656
 
succumbed       9410
657
 
Nabisco 9410
658
 
fingerings      9410
659
 
aging   9410
660
 
afield  9410
661
 
ammonium        9410
662
 
boat    9410
663
 
intelligibility 9410
664
 
Augustine       9410
665
 
teethe  9410
666
 
dreaded 9410
667
 
scholastics     9410
668
 
audiology       9410
669
 
wallet  9410
670
 
parters 9410
671
 
eschew  9410
672
 
quitter 9410
673
 
neat    9410
674
 
Steinberg       9410
675
 
jarring 9410
676
 
tinily  9410
677
 
balled  9410
678
 
persist 9410
679
 
attainments     9410
680
 
fanatic 9410
681
 
measures        9410
682
 
rightfulness    9410
683
 
capably 9410
684
 
impulsive       9410
685
 
starlet 9410
686
 
terminators     9410
687
 
untying 9410
688
 
announces       9410
689
 
featherweight   9410
690
 
pessimist       9410
691
 
daughter        9410
692
 
decliner        9410
693
 
lawgiver        9410
694
 
stated  9410
695
 
readable        9410
696
 
attrition       9410
697
 
cascade 9410
698
 
motors  9410
699
 
interrogate     9410
700
 
pests   9410
701
 
stairway        9410
702
 
dopers  9410
703
 
testicle        9410
704
 
Parsifal        9410
705
 
leavings        9410
706
 
postulation     9410
707
 
squeaking       9410
708
 
contrasted      9410
709
 
leftover        9410
710
 
whiteners       9410
711
 
erases  9410
712
 
Punjab  9410
713
 
Merritt 9410
714
 
Quixotism       9410
715
 
sweetish        9410
716
 
dogging 9410
717
 
scornfully      9410
718
 
bellow  9410
719
 
bills   9410
720
 
cupboard        9410
721
 
sureties        9410
722
 
puddings        9410
723
 
fetters 9410
724
 
bivalves        9410
725
 
incurring       9410
726
 
Adolph  9410
727
 
pithed  9410
728
 
Miles   9410
729
 
trimmings       9410
730
 
tragedies       9410
731
 
skulking        9410
732
 
flint   9410
733
 
flopping        9410
734
 
relaxing        9410
735
 
offload 9410
736
 
suites  9410
737
 
lists   9410
738
 
animized        9410
739
 
multilayer      9410
740
 
standardizes    9410
741
 
Judas   9410
742
 
vacuuming       9410
743
 
dentally        9410
744
 
humanness       9410
745
 
inch    9410
746
 
Weissmuller     9410
747
 
irresponsibly   9410
748
 
luckily 9410
749
 
culled  9410
750
 
medical 9410
751
 
bloodbath       9410
752
 
subschema       9410
753
 
animals 9410
754
 
Micronesia      9410
755
 
repetitions     9410
756
 
Antares 9410
757
 
ventilate       9410
758
 
pityingly       9410
759
 
interdependent  9410
760
 
Graves  9410
761
 
neonatal        9410
762
 
chafe   9410
763
 
honoring        9410
764
 
realtor 9410
765
 
elite   9410
766
 
funereal        9410
767
 
abrogating      9410
768
 
sorters 9410
769
 
Conley  9410
770
 
lectured        9410
771
 
Abraham 9410
772
 
Hawaii  9410
773
 
cage    9410
774
 
hushes  9410
775
 
Simla   9410
776
 
reporters       9410
777
 
Dutchman        9410
778
 
descendants     9410
779
 
groupings       9410
780
 
dissociate      9410
781
 
coexist 9410
782
 
Beebe   9410
783
 
Taoism  9410
784
 
Connally        9410
785
 
fetched 9410
786
 
checkpoints     9410
787
 
rusting 9410
788
 
galling 9410
789
 
obliterates     9410
790
 
traitor 9410
791
 
resumes 9410
792
 
analyzable      9410
793
 
terminator      9410
794
 
gritty  9410
795
 
firearm 9410
796
 
minima  9410
797
 
Selfridge       9410
798
 
disable 9410
799
 
witchcraft      9410
800
 
betroth 9410
801
 
Manhattanize    9410
802
 
imprint 9410
803
 
peeked  9410
804
 
swelling        9410
805
 
interrelationships      9410
806
 
riser   9410
807
 
Gandhian        9410
808
 
peacock 9410
809
 
bee     9410
810
 
kanji   9410
811
 
dental  9410
812
 
scarf   9410
813
 
chasm   9410
814
 
insolence       9410
815
 
syndicate       9410
816
 
alike   9410
817
 
imperial        9410
818
 
convulsion      9410
819
 
railway 9410
820
 
validate        9410
821
 
normalizes      9410
822
 
comprehensive   9410
823
 
chewing 9410
824
 
denizen 9410
825
 
schemer 9410
826
 
chronicle       9410
827
 
Kline   9410
828
 
Anatole 9410
829
 
partridges      9410
830
 
brunch  9410
831
 
recruited       9410
832
 
dimensions      9410
833
 
Chicana 9410
834
 
announced       9410
835
 
praised 9410
836
 
employing       9410
837
 
linear  9410
838
 
quagmire        9410
839
 
western 9410
840
 
relishing       9410
841
 
serving 9410
842
 
scheduling      9410
843
 
lore    9410
844
 
eventful        9410
845
 
arteriole       9410
846
 
disentangle     9410
847
 
cured   9410
848
 
Fenton  9410
849
 
avoidable       9410
850
 
drains  9410
851
 
detectably      9410
852
 
husky   9410
853
 
impelling       9410
854
 
undoes  9410
855
 
evened  9410
856
 
squeezes        9410
857
 
destroyer       9410
858
 
rudeness        9410
859
 
beaner  9410
860
 
boorish 9410
861
 
Everhart        9410
862
 
encompass       9410
863
 
mushrooms       9410
864
 
Alison  9410
865
 
externally      9410
866
 
pellagra        9410
867
 
cult    9410
868
 
creek   9410
869
 
Huffman 9410
870
 
Majorca 9410
871
 
governing       9410
872
 
gadfly  9410
873
 
reassigned      9410
874
 
intentness      9410
875
 
craziness       9410
876
 
psychic 9410
877
 
squabbled       9410
878
 
burlesque       9410
879
 
capped  9410
880
 
extracted       9410
881
 
DiMaggio        9410
882
 
exclamation     9410
883
 
subdirectory    9410
884
 
Gothicism       9410
885
 
feminine        9410
886
 
metaphysically  9410
887
 
sanding 9410
888
 
Miltonism       9410
889
 
freakish        9410
890
 
index   9410
891
 
straight        9410
892
 
flurried        9410
893
 
denotative      9410
894
 
coming  9410
895
 
commencements   9410
896
 
gentleman       9410
897
 
gifted  9410
898
 
Shanghais       9410
899
 
sportswriting   9410
900
 
sloping 9410
901
 
navies  9410
902
 
leaflet 9410
903
 
shooter 9410
904
 
Joplin  9410
905
 
babies  9410
906
 
assails 9410
907
 
admiring        9410
908
 
swaying 9410
909
 
Goldstine       9410
910
 
fitting 9410
911
 
Norwalk 9410
912
 
analogy 9410
913
 
deludes 9410
914
 
cokes   9410
915
 
Clayton 9410
916
 
exhausts        9410
917
 
causality       9410
918
 
sating  9410
919
 
icon    9410
920
 
throttles       9410
921
 
communicants    9410
922
 
dehydrate       9410
923
 
priceless       9410
924
 
publicly        9410
925
 
incidentals     9410
926
 
commonplace     9410
927
 
mumbles 9410
928
 
furthermore     9410
929
 
cautioned       9410
930
 
parametrized    9410
931
 
registration    9410
932
 
sadly   9410
933
 
positioning     9410
934
 
babysitting     9410
935
 
eternal 9410
936
 
hoarder 9410
937
 
congregates     9410
938
 
rains   9410
939
 
workers 9410
940
 
sags    9410
941
 
unplug  9410
942
 
garage  9410
943
 
boulder 9410
944
 
specifics       9410
945
 
Teresa  9410
946
 
Winsett 9410
947
 
convenient      9410
948
 
buckboards      9410
949
 
amenities       9410
950
 
resplendent     9410
951
 
sews    9410
952
 
participated    9410
953
 
Simon   9410
954
 
certificates    9410
955
 
Fitzpatrick     9410
956
 
Evanston        9410
957
 
misted  9410
958
 
textures        9410
959
 
save    9410
960
 
count   9410
961
 
rightful        9410
962
 
chaperone       9410
963
 
Lizzy   9410
964
 
clenched        9410
965
 
effortlessly    9410
966
 
accessed        9410
967
 
beaters 9410
968
 
Hornblower      9410
969
 
vests   9410
970
 
indulgences     9410
971
 
infallibly      9410
972
 
unwilling       9410
973
 
excrete 9410
974
 
spools  9410
975
 
crunches        9410
976
 
overestimating  9410
977
 
ineffective     9410
978
 
humiliation     9410
979
 
sophomore       9410
980
 
star    9410
981
 
rifles  9410
982
 
dialysis        9410
983
 
arriving        9410
984
 
indulge 9410
985
 
clockers        9410
986
 
languages       9410
987
 
Antarctica      9410
988
 
percentage      9410
989
 
ceiling 9410
990
 
specification   9410
991
 
regimented      9410
992
 
ciphers 9410
993
 
pictures        9410
994
 
serpents        9410
995
 
allot   9410
996
 
realized        9410
997
 
mayoral 9410
998
 
opaquely        9410
999
 
hostess 9410
1000
 
fiftieth        9410
1001
 
incorrectly     9410
1002
 
decomposition   9410
1003
 
stranglings     9410
1004
 
mixture 9410
1005
 
electroencephalography  9410
1006
 
similarities    9410
1007
 
charges 9410
1008
 
freest  9410
1009
 
Greenberg       9410
1010
 
tinting 9410
1011
 
expelled        9410
1012
 
warm    9410
1013
 
smoothed        9410
1014
 
deductions      9410
1015
 
Romano  9410
1016
 
bitterroot      9410
1017
 
corset  9410
1018
 
securing        9410
1019
 
environing      9410
1020
 
cute    9410
1021
 
Crays   9410
1022
 
heiress 9410
1023
 
inform  9410
1024
 
avenge  9410
1025
 
universals      9410
1026
 
Kinsey  9410
1027
 
ravines 9410
1028
 
bestseller      9410
1029
 
equilibrium     9410
1030
 
extents 9410
1031
 
relatively      9410
1032
 
pressure        9410
1033
 
critiques       9410
1034
 
befouled        9410
1035
 
rightfully      9410
1036
 
mechanizing     9410
1037
 
Latinizes       9410
1038
 
timesharing     9410
1039
 
Aden    9410
1040
 
embassies       9410
1041
 
males   9410
1042
 
shapelessly     9410
1043
 
mastering       9410
1044
 
Newtonian       9410
1045
 
finishers       9410
1046
 
abates  9410
1047
 
teem    9410
1048
 
kiting  9410
1049
 
stodgy  9410
1050
 
feed    9410
1051
 
guitars 9410
1052
 
airships        9410
1053
 
store   9410
1054
 
denounces       9410
1055
 
Pyle    9410
1056
 
Saxony  9410
1057
 
serializations  9410
1058
 
Peruvian        9410
1059
 
taxonomically   9410
1060
 
kingdom 9410
1061
 
stint   9410
1062
 
Sault   9410
1063
 
faithful        9410
1064
 
Ganymede        9410
1065
 
tidiness        9410
1066
 
gainful 9410
1067
 
contrary        9410
1068
 
Tipperary       9410
1069
 
tropics 9410
1070
 
theorizers      9410
1071
 
renew   9410
1072
 
already 9410
1073
 
terminal        9410
1074
 
Hegelian        9410
1075
 
hypothesizer    9410
1076
 
warningly       9410
1077
 
journalizing    9410
1078
 
nested  9410
1079
 
Lars    9410
1080
 
saplings        9410
1081
 
foothill        9410
1082
 
labeled 9410
1083
 
imperiously     9410
1084
 
reporters       9410
1085
 
furnishings     9410
1086
 
precipitable    9410
1087
 
discounts       9410
1088
 
excises 9410
1089
 
Stalin  9410
1090
 
despot  9410
1091
 
ripeness        9410
1092
 
Arabia  9410
1093
 
unruly  9410
1094
 
mournfulness    9410
1095
 
boom    9410
1096
 
slaughter       9410
1097
 
Sabine  9410
1098
 
handy   9410
1099
 
rural   9410
1100
 
organizer       9410
1101
 
shipyard        9410
1102
 
civics  9410
1103
 
inaccuracy      9410
1104
 
rules   9410
1105
 
juveniles       9410
1106
 
comprised       9410
1107
 
investigations  9410
1108
 
stabilizes      9410
1109
 
seminaries      9410
1110
 
Hunter  9410
1111
 
sporty  9410
1112
 
test    9410
1113
 
weasels 9410
1114
 
CERN    9410
1115
 
tempering       9410
1116
 
afore   9410
1117
 
Galatean        9410
1118
 
techniques      9410
1119
 
error   9410
1120
 
veranda 9410
1121
 
severely        9410
1122
 
Cassites        9410
1123
 
forthcoming     9410
1124
 
guides  9410
1125
 
vanish  9410
1126
 
lied    9410
1127
 
sawtooth        9410
1128
 
fated   9410
1129
 
gradually       9410
1130
 
widens  9410
1131
 
preclude        9410
1132
 
evenhandedly    9410
1133
 
percentage      9410
1134
 
disobedience    9410
1135
 
humility        9410
1136
 
gleaning        9410
1137
 
petted  9410
1138
 
bloater 9410
1139
 
minion  9410
1140
 
marginal        9410
1141
 
apiary  9410
1142
 
measures        9410
1143
 
precaution      9410
1144
 
repelled        9410
1145
 
primary 9410
1146
 
coverings       9410
1147
 
Artemia 9410
1148
 
navigate        9410
1149
 
spatial 9410
1150
 
Gurkha  9410
1151
 
meanwhile       9410
1152
 
Melinda 9410
1153
 
Butterfield     9410
1154
 
Aldrich 9410
1155
 
previewing      9410
1156
 
glut    9410
1157
 
unaffected      9410
1158
 
inmate  9410
1159
 
mineral 9410
1160
 
impending       9410
1161
 
meditation      9410
1162
 
ideas   9410
1163
 
miniaturizes    9410
1164
 
lewdly  9410
1165
 
title   9410
1166
 
youthfulness    9410
1167
 
creak   9410
1168
 
Chippewa        9410
1169
 
clamored        9410
1170
 
freezes 9410
1171
 
forgivably      9410
1172
 
reduce  9410
1173
 
McGovern        9410
1174
 
Nazis   9410
1175
 
epistle 9410
1176
 
socializes      9410
1177
 
conceptions     9410
1178
 
Kevin   9410
1179
 
uncovering      9410
1180
 
chews   9410
1181
 
appendixes      9410
1182
 
appendixes      9410
1183
 
appendixes      9410
1184
 
appendixes      9410
1185
 
appendixes      9410
1186
 
appendixes      9410
1187
 
raining 9410
1188
 
infest  9410
1189
 
compartment     9410
1190
 
minting 9410
1191
 
ducks   9410
1192
 
roped   9410
1193
 
waltz   9410
1194
 
Lillian 9410
1195
 
repressions     9410
1196
 
chillingly      9410
1197
 
noncritical     9410
1198
 
lithograph      9410
1199
 
spongers        9410
1200
 
parenthood      9410
1201
 
posed   9410
1202
 
instruments     9410
1203
 
filial  9410
1204
 
fixedly 9410
1205
 
relives 9410
1206
 
Pandora 9410
1207
 
watering        9410
1208
 
ungrateful      9410
1209
 
secures 9410
1210
 
poison  9410
1211
 
dusted  9410
1212
 
encompasses     9410
1213
 
presentation    9410
1214
 
Kantian 9410
1215
 
select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price;
1216
 
fld3    period  price   price2
1217
 
admonishing     1002    28357832        8723648
1218
 
analyzable      1002    28357832        8723648
1219
 
annihilates     1001    5987435 234724
1220
 
Antares 1002    28357832        8723648
1221
 
astound 1001    5987435 234724
1222
 
audiology       1001    5987435 234724
1223
 
Augustine       1002    28357832        8723648
1224
 
Baird   1002    28357832        8723648
1225
 
bewilderingly   1001    5987435 234724
1226
 
breaking        1001    5987435 234724
1227
 
Conley  1001    5987435 234724
1228
 
dentally        1002    28357832        8723648
1229
 
dissociate      1002    28357832        8723648
1230
 
elite   1001    5987435 234724
1231
 
eschew  1001    5987435 234724
1232
 
Eulerian        1001    5987435 234724
1233
 
flanking        1001    5987435 234724
1234
 
foldout 1002    28357832        8723648
1235
 
funereal        1002    28357832        8723648
1236
 
galling 1002    28357832        8723648
1237
 
Graves  1001    5987435 234724
1238
 
grazing 1001    5987435 234724
1239
 
groupings       1001    5987435 234724
1240
 
handgun 1001    5987435 234724
1241
 
humility        1002    28357832        8723648
1242
 
impulsive       1002    28357832        8723648
1243
 
inch    1001    5987435 234724
1244
 
intelligibility 1001    5987435 234724
1245
 
jarring 1001    5987435 234724
1246
 
lawgiver        1001    5987435 234724
1247
 
lectured        1002    28357832        8723648
1248
 
Merritt 1002    28357832        8723648
1249
 
neonatal        1001    5987435 234724
1250
 
offload 1002    28357832        8723648
1251
 
parters 1002    28357832        8723648
1252
 
pityingly       1002    28357832        8723648
1253
 
puddings        1002    28357832        8723648
1254
 
Punjab  1001    5987435 234724
1255
 
quitter 1002    28357832        8723648
1256
 
realtor 1001    5987435 234724
1257
 
relaxing        1001    5987435 234724
1258
 
repetitions     1001    5987435 234724
1259
 
resumes 1001    5987435 234724
1260
 
Romans  1002    28357832        8723648
1261
 
rusting 1001    5987435 234724
1262
 
scholastics     1001    5987435 234724
1263
 
skulking        1002    28357832        8723648
1264
 
stated  1002    28357832        8723648
1265
 
suites  1002    28357832        8723648
1266
 
sureties        1001    5987435 234724
1267
 
testicle        1002    28357832        8723648
1268
 
tinily  1002    28357832        8723648
1269
 
tragedies       1001    5987435 234724
1270
 
trimmings       1001    5987435 234724
1271
 
vacuuming       1001    5987435 234724
1272
 
ventilate       1001    5987435 234724
1273
 
wallet  1001    5987435 234724
1274
 
Weissmuller     1002    28357832        8723648
1275
 
Wotan   1002    28357832        8723648
1276
 
select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37;
1277
 
fld1    fld3    period  price   price2
1278
 
18201   relaxing        1001    5987435 234724
1279
 
18601   vacuuming       1001    5987435 234724
1280
 
18801   inch    1001    5987435 234724
1281
 
18811   repetitions     1001    5987435 234724
1282
 
create table t4 (
1283
 
companynr int NOT NULL default '00',
1284
 
companyname char(30) NOT NULL default '',
1285
 
PRIMARY KEY (companynr),
1286
 
UNIQUE KEY companyname(companyname)
1287
 
) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
1288
 
select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
1289
 
companynr       companyname
1290
 
0       Unknown
1291
 
29      company 1
1292
 
34      company 2
1293
 
36      company 3
1294
 
37      company 4
1295
 
40      company 5
1296
 
41      company 6
1297
 
50      company 11
1298
 
53      company 7
1299
 
58      company 8
1300
 
65      company 9
1301
 
68      company 10
1302
 
select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
1303
 
companynr       companyname
1304
 
0       Unknown
1305
 
29      company 1
1306
 
34      company 2
1307
 
36      company 3
1308
 
37      company 4
1309
 
40      company 5
1310
 
41      company 6
1311
 
50      company 11
1312
 
53      company 7
1313
 
58      company 8
1314
 
65      company 9
1315
 
68      company 10
1316
 
select * from t1,t1 t12;
1317
 
Period  Varor_period    Period  Varor_period
1318
 
9410    9412    9410    9412
1319
 
select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505;
1320
 
fld1    fld1
1321
 
250501  250501
1322
 
250502  250501
1323
 
250503  250501
1324
 
250504  250501
1325
 
250505  250501
1326
 
250501  250502
1327
 
250502  250502
1328
 
250503  250502
1329
 
250504  250502
1330
 
250505  250502
1331
 
250501  250503
1332
 
250502  250503
1333
 
250503  250503
1334
 
250504  250503
1335
 
250505  250503
1336
 
250501  250504
1337
 
250502  250504
1338
 
250503  250504
1339
 
250504  250504
1340
 
250505  250504
1341
 
250501  250505
1342
 
250502  250505
1343
 
250503  250505
1344
 
250504  250505
1345
 
250505  250505
1346
 
insert into t2 (fld1, companynr) values (999999,99);
1347
 
select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
1348
 
companynr       companyname
1349
 
99      NULL
1350
 
select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null;
1351
 
count(*)
1352
 
1199
1353
 
explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
1354
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1355
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1200    
1356
 
1       SIMPLE  t4      eq_ref  PRIMARY PRIMARY 4       test.t2.companynr       1       Using where; Not exists
1357
 
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null;
1358
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1359
 
1       SIMPLE  t4      ALL     NULL    NULL    NULL    NULL    12      
1360
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1200    Using where; Not exists
1361
 
select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
1362
 
companynr       companyname
1363
 
select count(*) from t2 left join t4 using (companynr) where companynr is not null;
1364
 
count(*)
1365
 
1200
1366
 
explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
1367
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1368
 
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE
1369
 
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null;
1370
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1371
 
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE
1372
 
delete from t2 where fld1=999999;
1373
 
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
1374
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1375
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    Using where
1376
 
1       SIMPLE  t4      eq_ref  PRIMARY PRIMARY 4       test.t2.companynr       1       
1377
 
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
1378
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1379
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    Using where
1380
 
1       SIMPLE  t4      eq_ref  PRIMARY PRIMARY 4       test.t2.companynr       1       
1381
 
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
1382
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1383
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    Using where
1384
 
1       SIMPLE  t4      eq_ref  PRIMARY PRIMARY 4       test.t2.companynr       1       
1385
 
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
1386
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1387
 
1       SIMPLE  t4      ALL     PRIMARY NULL    NULL    NULL    12      Using where
1388
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    
1389
 
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0;
1390
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1391
 
1       SIMPLE  t4      ALL     PRIMARY NULL    NULL    NULL    12      Using where
1392
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    
1393
 
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0;
1394
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1395
 
1       SIMPLE  t4      ALL     PRIMARY NULL    NULL    NULL    12      Using where
1396
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    
1397
 
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null;
1398
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1399
 
1       SIMPLE  t4      ALL     NULL    NULL    NULL    NULL    12      
1400
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    Using where
1401
 
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0;
1402
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1403
 
1       SIMPLE  t4      ALL     PRIMARY NULL    NULL    NULL    12      
1404
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    Using where
1405
 
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0;
1406
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1407
 
1       SIMPLE  t4      ALL     NULL    NULL    NULL    NULL    12      
1408
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    Using where
1409
 
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null;
1410
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1411
 
1       SIMPLE  t4      ALL     PRIMARY NULL    NULL    NULL    12      Using where
1412
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    
1413
 
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
1414
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1415
 
1       SIMPLE  t4      ALL     PRIMARY NULL    NULL    NULL    12      Using where
1416
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    
1417
 
explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;
1418
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1419
 
1       SIMPLE  t4      ALL     NULL    NULL    NULL    NULL    12      Using where
1420
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    
1421
 
select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
1422
 
companynr       companynr
1423
 
37      36
1424
 
41      40
1425
 
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
1426
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1427
 
1       SIMPLE  t4      index   NULL    PRIMARY 4       NULL    12      Using index; Using temporary
1428
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    Using where; Using join buffer
1429
 
select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
1430
 
fld1    companynr       fld3    period
1431
 
38008   37      reporters       1008
1432
 
38208   37      Selfridge       1008
1433
 
select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
1434
 
fld1    companynr       fld3    period
1435
 
38008   37      reporters       1008
1436
 
38208   37      Selfridge       1008
1437
 
select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
1438
 
fld1    companynr       fld3    period
1439
 
38008   37      reporters       1008
1440
 
38208   37      Selfridge       1008
1441
 
select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909);
1442
 
period
1443
 
9410
1444
 
select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6)));
1445
 
period
1446
 
9410
1447
 
select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1;
1448
 
fld1
1449
 
250501
1450
 
250502
1451
 
250503
1452
 
250505
1453
 
select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606);
1454
 
fld1
1455
 
250502
1456
 
250503
1457
 
select fld1 from t2 where fld1 between 250502 and 250504;
1458
 
fld1
1459
 
250502
1460
 
250503
1461
 
250504
1462
 
select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ;
1463
 
fld3
1464
 
label
1465
 
labeled
1466
 
labeled
1467
 
landslide
1468
 
laterally
1469
 
leaflet
1470
 
lewdly
1471
 
Lillian
1472
 
luckily
1473
 
select count(*) from t1;
1474
 
count(*)
1475
 
1
1476
 
select companynr,count(*),sum(fld1) from t2 group by companynr;
1477
 
companynr       count(*)        sum(fld1)
1478
 
0       82      10355753
1479
 
29      95      14473298
1480
 
34      70      17788966
1481
 
36      215     22786296
1482
 
37      588     83602098
1483
 
40      37      6618386
1484
 
41      52      12816335
1485
 
50      11      1595438
1486
 
53      4       793210
1487
 
58      23      2254293
1488
 
65      10      2284055
1489
 
68      12      3097288
1490
 
select companynr,count(*) from t2 group by companynr order by companynr desc limit 5;
1491
 
companynr       count(*)
1492
 
68      12
1493
 
65      10
1494
 
58      23
1495
 
53      4
1496
 
50      11
1497
 
select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
1498
 
count(*)        min(fld4)       max(fld4)       sum(fld1)       avg(fld1)       std(fld1)       variance(fld1)
1499
 
70      absentee        vest    17788966        254128.0857     3272.5940       10709871.3069
1500
 
explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
1501
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
1502
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    100.00  Using where
1503
 
Warnings:
1504
 
Note    1003    select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> ''))
1505
 
select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3;
1506
 
companynr       count(*)        min(fld4)       max(fld4)       sum(fld1)       avg(fld1)       std(fld1)       variance(fld1)
1507
 
0       82      Anthony windmills       10355753        126289.6707     115550.9757     13352027981.7087
1508
 
29      95      abut    wetness 14473298        152350.5053     8368.5480       70032594.9026
1509
 
34      70      absentee        vest    17788966        254128.0857     3272.5940       10709871.3069
1510
 
select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
1511
 
companynr       t2nr    count(price)    sum(price)      min(price)      max(price)      avg(price)
1512
 
37      1       1       5987435 5987435 5987435 5987435.0000
1513
 
37      2       1       28357832        28357832        28357832        28357832.0000
1514
 
37      3       1       39654943        39654943        39654943        39654943.0000
1515
 
37      11      1       5987435 5987435 5987435 5987435.0000
1516
 
37      12      1       28357832        28357832        28357832        28357832.0000
1517
 
37      13      1       39654943        39654943        39654943        39654943.0000
1518
 
37      21      1       5987435 5987435 5987435 5987435.0000
1519
 
37      22      1       28357832        28357832        28357832        28357832.0000
1520
 
37      23      1       39654943        39654943        39654943        39654943.0000
1521
 
37      31      1       5987435 5987435 5987435 5987435.0000
1522
 
select /*! SQL_SMALL_RESULT */ companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
1523
 
companynr       t2nr    count(price)    sum(price)      min(price)      max(price)      avg(price)
1524
 
37      1       1       5987435 5987435 5987435 5987435.0000
1525
 
37      2       1       28357832        28357832        28357832        28357832.0000
1526
 
37      3       1       39654943        39654943        39654943        39654943.0000
1527
 
37      11      1       5987435 5987435 5987435 5987435.0000
1528
 
37      12      1       28357832        28357832        28357832        28357832.0000
1529
 
37      13      1       39654943        39654943        39654943        39654943.0000
1530
 
37      21      1       5987435 5987435 5987435 5987435.0000
1531
 
37      22      1       28357832        28357832        28357832        28357832.0000
1532
 
37      23      1       39654943        39654943        39654943        39654943.0000
1533
 
37      31      1       5987435 5987435 5987435 5987435.0000
1534
 
select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ;
1535
 
companynr       count(price)    sum(price)      min(price)      max(price)      avg(price)
1536
 
37      12543   309394878010    5987435 39654943        24666736.6667
1537
 
78      8362    414611089292    726498  98439034        49582766.0000
1538
 
101     4181    3489454238      834598  834598  834598.0000
1539
 
154     4181    4112197254950   983543950       983543950       983543950.0000
1540
 
311     4181    979599938       234298  234298  234298.0000
1541
 
447     4181    9929180954      2374834 2374834 2374834.0000
1542
 
512     4181    3288532102      786542  786542  786542.0000
1543
 
select distinct mod(companynr,10) from t4 group by companynr;
1544
 
mod(companynr,10)
1545
 
0
1546
 
9
1547
 
4
1548
 
6
1549
 
7
1550
 
1
1551
 
3
1552
 
8
1553
 
5
1554
 
select distinct 1 from t4 group by companynr;
1555
 
1
1556
 
1
1557
 
select count(distinct fld1) from t2;
1558
 
count(distinct fld1)
1559
 
1199
1560
 
select companynr,count(distinct fld1) from t2 group by companynr;
1561
 
companynr       count(distinct fld1)
1562
 
0       82
1563
 
29      95
1564
 
34      70
1565
 
36      215
1566
 
37      588
1567
 
40      37
1568
 
41      52
1569
 
50      11
1570
 
53      4
1571
 
58      23
1572
 
65      10
1573
 
68      12
1574
 
select companynr,count(*) from t2 group by companynr;
1575
 
companynr       count(*)
1576
 
0       82
1577
 
29      95
1578
 
34      70
1579
 
36      215
1580
 
37      588
1581
 
40      37
1582
 
41      52
1583
 
50      11
1584
 
53      4
1585
 
58      23
1586
 
65      10
1587
 
68      12
1588
 
select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr;
1589
 
companynr       count(distinct concat(fld1,repeat(65,1000)))
1590
 
0       82
1591
 
29      95
1592
 
34      70
1593
 
36      215
1594
 
37      588
1595
 
40      37
1596
 
41      52
1597
 
50      11
1598
 
53      4
1599
 
58      23
1600
 
65      10
1601
 
68      12
1602
 
select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr;
1603
 
companynr       count(distinct concat(fld1,repeat(65,200)))
1604
 
0       82
1605
 
29      95
1606
 
34      70
1607
 
36      215
1608
 
37      588
1609
 
40      37
1610
 
41      52
1611
 
50      11
1612
 
53      4
1613
 
58      23
1614
 
65      10
1615
 
68      12
1616
 
select companynr,count(distinct floor(fld1/100)) from t2 group by companynr;
1617
 
companynr       count(distinct floor(fld1/100))
1618
 
0       47
1619
 
29      35
1620
 
34      14
1621
 
36      69
1622
 
37      108
1623
 
40      16
1624
 
41      11
1625
 
50      9
1626
 
53      1
1627
 
58      1
1628
 
65      1
1629
 
68      1
1630
 
select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr;
1631
 
companynr       count(distinct concat(repeat(65,1000),floor(fld1/100)))
1632
 
0       47
1633
 
29      35
1634
 
34      14
1635
 
36      69
1636
 
37      108
1637
 
40      16
1638
 
41      11
1639
 
50      9
1640
 
53      1
1641
 
58      1
1642
 
65      1
1643
 
68      1
1644
 
select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10;
1645
 
sum(fld1)       fld3
1646
 
11402   Romans
1647
 
select name,count(*) from t3 where name='cloakroom' group by name;
1648
 
name    count(*)
1649
 
cloakroom       4181
1650
 
select name,count(*) from t3 where name='cloakroom' and price>10 group by name;
1651
 
name    count(*)
1652
 
cloakroom       4181
1653
 
select count(*) from t3 where name='cloakroom' and price2=823742;
1654
 
count(*)
1655
 
4181
1656
 
select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name;
1657
 
name    count(*)
1658
 
cloakroom       4181
1659
 
select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name;
1660
 
name    count(*)
1661
 
extramarital    4181
1662
 
gazer   4181
1663
 
gems    4181
1664
 
Iranizes        4181
1665
 
spates  4181
1666
 
tucked  4181
1667
 
violinist       4181
1668
 
select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
1669
 
fld3    count(*)
1670
 
spates  4181
1671
 
select companynr,companyname from t4 group by 1;
1672
 
companynr       companyname
1673
 
0       Unknown
1674
 
29      company 1
1675
 
34      company 2
1676
 
36      company 3
1677
 
37      company 4
1678
 
40      company 5
1679
 
41      company 6
1680
 
50      company 11
1681
 
53      company 7
1682
 
58      company 8
1683
 
65      company 9
1684
 
68      company 10
1685
 
select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname;
1686
 
companynr       companyname     count(*)
1687
 
29      company 1       95
1688
 
68      company 10      12
1689
 
50      company 11      11
1690
 
34      company 2       70
1691
 
36      company 3       215
1692
 
37      company 4       588
1693
 
40      company 5       37
1694
 
41      company 6       52
1695
 
53      company 7       4
1696
 
58      company 8       23
1697
 
65      company 9       10
1698
 
0       Unknown 82
1699
 
select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
1700
 
fld1    count(*)
1701
 
158402  4181
1702
 
select sum(Period)/count(*) from t1;
1703
 
sum(Period)/count(*)
1704
 
9410.0000
1705
 
select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr;
1706
 
companynr       count   sum     diff    func
1707
 
37      12543   309394878010    0.0000  464091
1708
 
78      8362    414611089292    0.0000  652236
1709
 
101     4181    3489454238      0.0000  422281
1710
 
154     4181    4112197254950   0.0000  643874
1711
 
311     4181    979599938       0.0000  1300291
1712
 
447     4181    9929180954      0.0000  1868907
1713
 
512     4181    3288532102      0.0000  2140672
1714
 
select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg;
1715
 
companynr       avg
1716
 
154     983543950.0000
1717
 
select companynr,count(*) from t2 group by companynr order by 2 desc;
1718
 
companynr       count(*)
1719
 
37      588
1720
 
36      215
1721
 
29      95
1722
 
0       82
1723
 
34      70
1724
 
41      52
1725
 
40      37
1726
 
58      23
1727
 
68      12
1728
 
50      11
1729
 
65      10
1730
 
53      4
1731
 
select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc;
1732
 
companynr       count(*)
1733
 
41      52
1734
 
58      23
1735
 
68      12
1736
 
50      11
1737
 
65      10
1738
 
53      4
1739
 
select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4;
1740
 
fld4    fld1    count(price)    sum(price)      min(price)      max(price)      avg(price)
1741
 
teethe  1       1       5987435 5987435 5987435 5987435.0000
1742
 
dreaded 11401   1       5987435 5987435 5987435 5987435.0000
1743
 
scholastics     11402   1       28357832        28357832        28357832        28357832.0000
1744
 
audiology       11403   1       39654943        39654943        39654943        39654943.0000
1745
 
wallet  11501   1       5987435 5987435 5987435 5987435.0000
1746
 
parters 11701   1       5987435 5987435 5987435 5987435.0000
1747
 
eschew  11702   1       28357832        28357832        28357832        28357832.0000
1748
 
quitter 11703   1       39654943        39654943        39654943        39654943.0000
1749
 
neat    12001   1       5987435 5987435 5987435 5987435.0000
1750
 
Steinberg       12003   1       39654943        39654943        39654943        39654943.0000
1751
 
balled  12301   1       5987435 5987435 5987435 5987435.0000
1752
 
persist 12302   1       28357832        28357832        28357832        28357832.0000
1753
 
attainments     12303   1       39654943        39654943        39654943        39654943.0000
1754
 
capably 12501   1       5987435 5987435 5987435 5987435.0000
1755
 
impulsive       12602   1       28357832        28357832        28357832        28357832.0000
1756
 
starlet 12603   1       39654943        39654943        39654943        39654943.0000
1757
 
featherweight   12701   1       5987435 5987435 5987435 5987435.0000
1758
 
pessimist       12702   1       28357832        28357832        28357832        28357832.0000
1759
 
daughter        12703   1       39654943        39654943        39654943        39654943.0000
1760
 
lawgiver        13601   1       5987435 5987435 5987435 5987435.0000
1761
 
stated  13602   1       28357832        28357832        28357832        28357832.0000
1762
 
readable        13603   1       39654943        39654943        39654943        39654943.0000
1763
 
testicle        13801   1       5987435 5987435 5987435 5987435.0000
1764
 
Parsifal        13802   1       28357832        28357832        28357832        28357832.0000
1765
 
leavings        13803   1       39654943        39654943        39654943        39654943.0000
1766
 
squeaking       13901   1       5987435 5987435 5987435 5987435.0000
1767
 
contrasted      16001   1       5987435 5987435 5987435 5987435.0000
1768
 
leftover        16201   1       5987435 5987435 5987435 5987435.0000
1769
 
whiteners       16202   1       28357832        28357832        28357832        28357832.0000
1770
 
erases  16301   1       5987435 5987435 5987435 5987435.0000
1771
 
Punjab  16302   1       28357832        28357832        28357832        28357832.0000
1772
 
Merritt 16303   1       39654943        39654943        39654943        39654943.0000
1773
 
sweetish        18001   1       5987435 5987435 5987435 5987435.0000
1774
 
dogging 18002   1       28357832        28357832        28357832        28357832.0000
1775
 
scornfully      18003   1       39654943        39654943        39654943        39654943.0000
1776
 
fetters 18012   1       28357832        28357832        28357832        28357832.0000
1777
 
bivalves        18013   1       39654943        39654943        39654943        39654943.0000
1778
 
skulking        18021   1       5987435 5987435 5987435 5987435.0000
1779
 
flint   18022   1       28357832        28357832        28357832        28357832.0000
1780
 
flopping        18023   1       39654943        39654943        39654943        39654943.0000
1781
 
Judas   18032   1       28357832        28357832        28357832        28357832.0000
1782
 
vacuuming       18033   1       39654943        39654943        39654943        39654943.0000
1783
 
medical 18041   1       5987435 5987435 5987435 5987435.0000
1784
 
bloodbath       18042   1       28357832        28357832        28357832        28357832.0000
1785
 
subschema       18043   1       39654943        39654943        39654943        39654943.0000
1786
 
interdependent  18051   1       5987435 5987435 5987435 5987435.0000
1787
 
Graves  18052   1       28357832        28357832        28357832        28357832.0000
1788
 
neonatal        18053   1       39654943        39654943        39654943        39654943.0000
1789
 
sorters 18061   1       5987435 5987435 5987435 5987435.0000
1790
 
epistle 18062   1       28357832        28357832        28357832        28357832.0000
1791
 
Conley  18101   1       5987435 5987435 5987435 5987435.0000
1792
 
lectured        18102   1       28357832        28357832        28357832        28357832.0000
1793
 
Abraham 18103   1       39654943        39654943        39654943        39654943.0000
1794
 
cage    18201   1       5987435 5987435 5987435 5987435.0000
1795
 
hushes  18202   1       28357832        28357832        28357832        28357832.0000
1796
 
Simla   18402   1       28357832        28357832        28357832        28357832.0000
1797
 
reporters       18403   1       39654943        39654943        39654943        39654943.0000
1798
 
coexist 18601   1       5987435 5987435 5987435 5987435.0000
1799
 
Beebe   18602   1       28357832        28357832        28357832        28357832.0000
1800
 
Taoism  18603   1       39654943        39654943        39654943        39654943.0000
1801
 
Connally        18801   1       5987435 5987435 5987435 5987435.0000
1802
 
fetched 18802   1       28357832        28357832        28357832        28357832.0000
1803
 
checkpoints     18803   1       39654943        39654943        39654943        39654943.0000
1804
 
gritty  18811   1       5987435 5987435 5987435 5987435.0000
1805
 
firearm 18812   1       28357832        28357832        28357832        28357832.0000
1806
 
minima  19101   1       5987435 5987435 5987435 5987435.0000
1807
 
Selfridge       19102   1       28357832        28357832        28357832        28357832.0000
1808
 
disable 19103   1       39654943        39654943        39654943        39654943.0000
1809
 
witchcraft      19201   1       5987435 5987435 5987435 5987435.0000
1810
 
betroth 30501   1       5987435 5987435 5987435 5987435.0000
1811
 
Manhattanize    30502   1       28357832        28357832        28357832        28357832.0000
1812
 
imprint 30503   1       39654943        39654943        39654943        39654943.0000
1813
 
swelling        31901   1       5987435 5987435 5987435 5987435.0000
1814
 
interrelationships      36001   1       5987435 5987435 5987435 5987435.0000
1815
 
riser   36002   1       28357832        28357832        28357832        28357832.0000
1816
 
bee     38001   1       5987435 5987435 5987435 5987435.0000
1817
 
kanji   38002   1       28357832        28357832        28357832        28357832.0000
1818
 
dental  38003   1       39654943        39654943        39654943        39654943.0000
1819
 
railway 38011   1       5987435 5987435 5987435 5987435.0000
1820
 
validate        38012   1       28357832        28357832        28357832        28357832.0000
1821
 
normalizes      38013   1       39654943        39654943        39654943        39654943.0000
1822
 
Kline   38101   1       5987435 5987435 5987435 5987435.0000
1823
 
Anatole 38102   1       28357832        28357832        28357832        28357832.0000
1824
 
partridges      38103   1       39654943        39654943        39654943        39654943.0000
1825
 
recruited       38201   1       5987435 5987435 5987435 5987435.0000
1826
 
dimensions      38202   1       28357832        28357832        28357832        28357832.0000
1827
 
Chicana 38203   1       39654943        39654943        39654943        39654943.0000
1828
 
select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3;
1829
 
companynr       fld3    sum(price)
1830
 
512     boat    786542
1831
 
512     capably 786542
1832
 
512     cupboard        786542
1833
 
512     decliner        786542
1834
 
512     descendants     786542
1835
 
512     dopers  786542
1836
 
512     erases  786542
1837
 
512     Micronesia      786542
1838
 
512     Miles   786542
1839
 
512     skies   786542
1840
 
select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr;
1841
 
companynr       count(*)        min(fld3)       max(fld3)       sum(price)      avg(price)
1842
 
0       1       Omaha   Omaha   5987435 5987435.0000
1843
 
36      1       dubbed  dubbed  28357832        28357832.0000
1844
 
37      83      Abraham Wotan   1908978016      22999735.1325
1845
 
50      2       scribbled       tapestry        68012775        34006387.5000
1846
 
select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1;
1847
 
t3.companynr+0  t2nr    fld3    sum(price)
1848
 
37      1       Omaha   5987435
1849
 
37      11401   breaking        5987435
1850
 
37      11402   Romans  28357832
1851
 
37      11403   intercepted     39654943
1852
 
37      11501   bewilderingly   5987435
1853
 
37      11701   astound 5987435
1854
 
37      11702   admonishing     28357832
1855
 
37      11703   sumac   39654943
1856
 
37      12001   flanking        5987435
1857
 
37      12003   combed  39654943
1858
 
37      12301   Eulerian        5987435
1859
 
37      12302   dubbed  28357832
1860
 
37      12303   Kane    39654943
1861
 
37      12501   annihilates     5987435
1862
 
37      12602   Wotan   28357832
1863
 
37      12603   snatching       39654943
1864
 
37      12701   grazing 5987435
1865
 
37      12702   Baird   28357832
1866
 
37      12703   celery  39654943
1867
 
37      13601   handgun 5987435
1868
 
37      13602   foldout 28357832
1869
 
37      13603   mystic  39654943
1870
 
37      13801   intelligibility 5987435
1871
 
37      13802   Augustine       28357832
1872
 
37      13803   teethe  39654943
1873
 
37      13901   scholastics     5987435
1874
 
37      16001   audiology       5987435
1875
 
37      16201   wallet  5987435
1876
 
37      16202   parters 28357832
1877
 
37      16301   eschew  5987435
1878
 
37      16302   quitter 28357832
1879
 
37      16303   neat    39654943
1880
 
37      18001   jarring 5987435
1881
 
37      18002   tinily  28357832
1882
 
37      18003   balled  39654943
1883
 
37      18012   impulsive       28357832
1884
 
37      18013   starlet 39654943
1885
 
37      18021   lawgiver        5987435
1886
 
37      18022   stated  28357832
1887
 
37      18023   readable        39654943
1888
 
37      18032   testicle        28357832
1889
 
37      18033   Parsifal        39654943
1890
 
37      18041   Punjab  5987435
1891
 
37      18042   Merritt 28357832
1892
 
37      18043   Quixotism       39654943
1893
 
37      18051   sureties        5987435
1894
 
37      18052   puddings        28357832
1895
 
37      18053   tapestry        39654943
1896
 
37      18061   trimmings       5987435
1897
 
37      18062   humility        28357832
1898
 
37      18101   tragedies       5987435
1899
 
37      18102   skulking        28357832
1900
 
37      18103   flint   39654943
1901
 
37      18201   relaxing        5987435
1902
 
37      18202   offload 28357832
1903
 
37      18402   suites  28357832
1904
 
37      18403   lists   39654943
1905
 
37      18601   vacuuming       5987435
1906
 
37      18602   dentally        28357832
1907
 
37      18603   humanness       39654943
1908
 
37      18801   inch    5987435
1909
 
37      18802   Weissmuller     28357832
1910
 
37      18803   irresponsibly   39654943
1911
 
37      18811   repetitions     5987435
1912
 
37      18812   Antares 28357832
1913
 
37      19101   ventilate       5987435
1914
 
37      19102   pityingly       28357832
1915
 
37      19103   interdependent  39654943
1916
 
37      19201   Graves  5987435
1917
 
37      30501   neonatal        5987435
1918
 
37      30502   scribbled       28357832
1919
 
37      30503   chafe   39654943
1920
 
37      31901   realtor 5987435
1921
 
37      36001   elite   5987435
1922
 
37      36002   funereal        28357832
1923
 
37      38001   Conley  5987435
1924
 
37      38002   lectured        28357832
1925
 
37      38003   Abraham 39654943
1926
 
37      38011   groupings       5987435
1927
 
37      38012   dissociate      28357832
1928
 
37      38013   coexist 39654943
1929
 
37      38101   rusting 5987435
1930
 
37      38102   galling 28357832
1931
 
37      38103   obliterates     39654943
1932
 
37      38201   resumes 5987435
1933
 
37      38202   analyzable      28357832
1934
 
37      38203   terminator      39654943
1935
 
select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008;
1936
 
sum(price)
1937
 
234298
1938
 
select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1;
1939
 
fld1    sum(price)
1940
 
38008   234298
1941
 
explain select fld3 from t2 where 1>2 or 2>3;
1942
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1943
 
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE
1944
 
explain select fld3 from t2 where fld1=fld1;
1945
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1946
 
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    
1947
 
select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502;
1948
 
companynr       fld1
1949
 
34      250501
1950
 
34      250502
1951
 
select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502;
1952
 
companynr       fld1
1953
 
34      250501
1954
 
34      250502
1955
 
select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000;
1956
 
companynr       count   sum
1957
 
0       82      10355753
1958
 
29      95      14473298
1959
 
34      70      17788966
1960
 
37      588     83602098
1961
 
41      52      12816335
1962
 
select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ;
1963
 
companynr
1964
 
0
1965
 
29
1966
 
34
1967
 
37
1968
 
41
1969
 
select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40;
1970
 
companynr       companyname     count(*)
1971
 
68      company 10      12
1972
 
50      company 11      11
1973
 
40      company 5       37
1974
 
41      company 6       52
1975
 
53      company 7       4
1976
 
58      company 8       23
1977
 
65      company 9       10
1978
 
select count(*) from t2;
1979
 
count(*)
1980
 
1199
1981
 
select count(*) from t2 where fld1 < 098024;
1982
 
count(*)
1983
 
387
1984
 
select min(fld1) from t2 where fld1>= 098024;
1985
 
min(fld1)
1986
 
98024
1987
 
select max(fld1) from t2 where fld1>= 098024;
1988
 
max(fld1)
1989
 
1232609
1990
 
select count(*) from t3 where price2=76234234;
1991
 
count(*)
1992
 
4181
1993
 
select count(*) from t3 where companynr=512 and price2=76234234;
1994
 
count(*)
1995
 
4181
1996
 
explain select min(fld1),max(fld1),count(*) from t2;
1997
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1998
 
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    Select tables optimized away
1999
 
select min(fld1),max(fld1),count(*) from t2;
2000
 
min(fld1)       max(fld1)       count(*)
2001
 
0       1232609 1199
2002
 
select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742;
2003
 
min(t2nr)       max(t2nr)
2004
 
2115    2115
2005
 
select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78;
2006
 
count(*)        min(t2nr)       max(t2nr)
2007
 
4181    4       41804
2008
 
select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20;
2009
 
t2nr    count(*)
2010
 
9       1
2011
 
19      1
2012
 
29      1
2013
 
39      1
2014
 
49      1
2015
 
59      1
2016
 
69      1
2017
 
79      1
2018
 
89      1
2019
 
99      1
2020
 
109     1
2021
 
119     1
2022
 
129     1
2023
 
139     1
2024
 
149     1
2025
 
159     1
2026
 
169     1
2027
 
179     1
2028
 
189     1
2029
 
199     1
2030
 
select max(t2nr) from t3 where price=983543950;
2031
 
max(t2nr)
2032
 
41807
2033
 
select t1.period from t3 = t1 limit 1;
2034
 
period
2035
 
1001
2036
 
select t1.period from t1 as t1 limit 1;
2037
 
period
2038
 
9410
2039
 
select t1.period as "Nuvarande period" from t1 as t1 limit 1;
2040
 
Nuvarande period
2041
 
9410
2042
 
select period as ok_period from t1 limit 1;
2043
 
ok_period
2044
 
9410
2045
 
select period as ok_period from t1 group by ok_period limit 1;
2046
 
ok_period
2047
 
9410
2048
 
select 1+1 as summa from t1 group by summa limit 1;
2049
 
summa
2050
 
2
2051
 
select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1;
2052
 
Nuvarande period
2053
 
9410
2054
 
show tables;
2055
 
Tables_in_test
2056
 
t1
2057
 
t2
2058
 
t3
2059
 
t4
2060
 
show tables from test like "s%";
2061
 
Tables_in_test (s%)
2062
 
show tables from test like "t?";
2063
 
Tables_in_test (t?)
2064
 
show full columns from t2;
2065
 
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
2066
 
auto    int     NULL    NO      PRI     NULL    auto_increment  #       
2067
 
fld1    int     NULL    NO      UNI     NULL            #       
2068
 
companynr       int     NULL    NO              NULL            #       
2069
 
fld3    varchar(30)     utf8_general_ci NO      MUL     NULL            #       
2070
 
fld4    varchar(35)     utf8_general_ci NO              NULL            #       
2071
 
fld5    varchar(35)     utf8_general_ci NO              NULL            #       
2072
 
fld6    varchar(4)      utf8_general_ci NO              NULL            #       
2073
 
show full columns from t2 from test like 'f%';
2074
 
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
2075
 
fld1    int     NULL    NO      UNI     NULL            #       
2076
 
fld3    varchar(30)     utf8_general_ci NO      MUL     NULL            #       
2077
 
fld4    varchar(35)     utf8_general_ci NO              NULL            #       
2078
 
fld5    varchar(35)     utf8_general_ci NO              NULL            #       
2079
 
fld6    varchar(4)      utf8_general_ci NO              NULL            #       
2080
 
show full columns from t2 from test like 's%';
2081
 
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
2082
 
show keys from t2;
2083
 
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
2084
 
t2      0       PRIMARY 1       auto    A       1199    NULL    NULL            BTREE           
2085
 
t2      0       fld1    1       fld1    A       1199    NULL    NULL            BTREE           
2086
 
t2      1       fld3    1       fld3    A       NULL    NULL    NULL            BTREE           
2087
 
drop table t4, t3, t2, t1;
2088
 
CREATE TABLE t1 (
2089
 
cont_nr int NOT NULL auto_increment,
2090
 
ver_nr int NOT NULL default '0',
2091
 
aufnr int NOT NULL default '0',
2092
 
username varchar(50) NOT NULL default '',
2093
 
hdl_nr int NOT NULL default '0',
2094
 
eintrag date NOT NULL default '0000-00-00',
2095
 
st_klasse varchar(40) NOT NULL default '',
2096
 
st_wert varchar(40) NOT NULL default '',
2097
 
st_zusatz varchar(40) NOT NULL default '',
2098
 
st_bemerkung varchar(255) NOT NULL default '',
2099
 
kunden_art varchar(40) NOT NULL default '',
2100
 
mcbs_knr int default NULL,
2101
 
mcbs_aufnr int NOT NULL default '0',
2102
 
schufa_status char(1) default '?',
2103
 
bemerkung text,
2104
 
wirknetz text,
2105
 
wf_igz int NOT NULL default '0',
2106
 
tarifcode varchar(80) default NULL,
2107
 
recycle char(1) default NULL,
2108
 
sim varchar(30) default NULL,
2109
 
mcbs_tpl varchar(30) default NULL,
2110
 
emp_nr int NOT NULL default '0',
2111
 
laufzeit int default NULL,
2112
 
hdl_name varchar(30) default NULL,
2113
 
prov_hdl_nr int NOT NULL default '0',
2114
 
auto_wirknetz varchar(50) default NULL,
2115
 
auto_billing varchar(50) default NULL,
2116
 
touch timestamp NOT NULL,
2117
 
kategorie varchar(50) default NULL,
2118
 
kundentyp varchar(20) NOT NULL default '',
2119
 
sammel_rech_msisdn varchar(30) NOT NULL default '',
2120
 
p_nr varchar(9) NOT NULL default '',
2121
 
suffix char(3) NOT NULL default '',
2122
 
PRIMARY KEY (cont_nr),
2123
 
KEY idx_aufnr(aufnr),
2124
 
KEY idx_hdl_nr(hdl_nr),
2125
 
KEY idx_st_klasse(st_klasse),
2126
 
KEY ver_nr(ver_nr),
2127
 
KEY eintrag_idx(eintrag),
2128
 
KEY emp_nr_idx(emp_nr),
2129
 
KEY wf_igz(wf_igz),
2130
 
KEY touch(touch),
2131
 
KEY hdl_tag(eintrag,hdl_nr),
2132
 
KEY prov_hdl_nr(prov_hdl_nr),
2133
 
KEY mcbs_aufnr(mcbs_aufnr),
2134
 
KEY kundentyp(kundentyp),
2135
 
KEY p_nr(p_nr,suffix)
2136
 
) ENGINE=MyISAM;
2137
 
INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
2138
 
INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
2139
 
INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
2140
 
INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
2141
 
INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007');
2142
 
INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
2143
 
INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
2144
 
SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie;
2145
 
Kundentyp       kategorie
2146
 
Privat (Private Nutzung)        Mobilfunk
2147
 
Warnings:
2148
 
Warning 1052    Column 'kundentyp' in group statement is ambiguous
2149
 
drop table t1;