~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/r/pool_of_threads.result

  • Committer: Monty Taylor
  • Date: 2008-07-05 18:10:38 UTC
  • mto: This revision was merged to the branch mainline in revision 63.
  • Revision ID: monty@inaugust.com-20080705181038-0ih0nnamu5qrut0y
Fixed prototypes. Cleaned define a little bit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
drop table if exists t1,t2,t3,t4;
2
2
CREATE TABLE t1 (
3
 
Period int DEFAULT '0000' NOT NULL,
4
 
Varor_period int DEFAULT '0' NOT NULL
5
 
) ENGINE=myisam;
 
3
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
 
4
Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
 
5
);
6
6
INSERT INTO t1 VALUES (9410,9412);
7
7
select period from t1;
8
8
period
15
15
9410    9412
16
16
CREATE TABLE t2 (
17
17
auto int not null auto_increment,
18
 
fld1 int DEFAULT '000000' NOT NULL,
19
 
companynr int DEFAULT '00' NOT NULL,
 
18
fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,
 
19
companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
20
20
fld3 char(30) DEFAULT '' NOT NULL,
21
21
fld4 char(35) DEFAULT '' NOT NULL,
22
22
fld5 char(35) DEFAULT '' NOT NULL,
24
24
UNIQUE fld1 (fld1),
25
25
KEY fld3 (fld3),
26
26
PRIMARY KEY (auto)
27
 
) ENGINE=myisam;
 
27
);
28
28
select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
29
29
fld3
30
30
imaginable
128
128
fld3
129
129
explain select t2.fld3 from t2 where fld3 = 'honeysuckle';
130
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
 
131
1       SIMPLE  t2      ref     fld3    fld3    30      const   1       Using where; Using index
132
132
explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle';
133
133
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
134
134
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    Using where
137
137
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    Using where
138
138
explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle';
139
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
 
140
1       SIMPLE  t2      ref     fld3    fld3    30      const   1       Using where; Using index
141
141
explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
142
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
 
143
1       SIMPLE  t2      ref     fld3    fld3    30      const   1       Using where; Using index
144
144
explain select fld3 from t2 ignore index (fld3,not_used);
145
145
ERROR 42000: Key 'not_used' doesn't exist in table 't2'
146
146
explain select fld3 from t2 use index (not_used);
151
151
honoring
152
152
explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
153
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
 
154
1       SIMPLE  t2      range   fld3    fld3    30      NULL    2       Using where; Using index
155
155
select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
156
156
fld1    fld3
157
157
148504  Colombo
158
 
68305   Colombo
159
 
0       nondecreasing
 
158
068305  Colombo
 
159
000000  nondecreasing
160
160
select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes';
161
161
fld1    fld3
162
162
232605  appendixes
183
183
1       SIMPLE  t2      range   fld1    fld1    4       NULL    4       Using where; Using index
184
184
select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%';
185
185
fld1    fld3
186
 
11402   Romans
187
 
11403   intercepted
188
 
11703   sumac
189
 
12001   flanking
190
 
12004   subjective
191
 
12005   scatterbrain
192
 
12303   Kane
193
 
12304   overlay
194
 
12305   perturb
195
 
12306   goblins
196
 
12602   Wotan
197
 
12603   snatching
198
 
12605   laterally
199
 
12606   yelped
200
 
12701   grazing
201
 
12704   misunderstander
202
 
13601   handgun
203
 
13602   foldout
204
 
13603   mystic
205
 
13604   succumbed
206
 
13605   Nabisco
207
 
13606   fingerings
208
 
13801   intelligibility
209
 
13803   teethe
210
 
13901   scholastics
211
 
16201   wallet
212
 
16202   parters
213
 
16302   quitter
214
 
16303   neat
215
 
16304   Steinberg
216
 
18001   jarring
217
 
18002   tinily
218
 
18004   persist
219
 
18007   fanatic
220
 
18008   measures
221
 
18009   rightfulness
222
 
18012   impulsive
223
 
18013   starlet
224
 
18014   terminators
225
 
18015   untying
226
 
18017   featherweight
227
 
18018   pessimist
228
 
18021   lawgiver
229
 
18022   stated
230
 
18023   readable
231
 
18026   motors
232
 
18027   interrogate
233
 
18028   pests
234
 
18029   stairway
235
 
18032   testicle
236
 
18033   Parsifal
237
 
18034   leavings
238
 
18035   postulation
239
 
18036   squeaking
240
 
18038   leftover
241
 
18039   whiteners
242
 
18041   Punjab
243
 
18042   Merritt
244
 
18043   Quixotism
245
 
18044   sweetish
246
 
18046   scornfully
247
 
18051   sureties
248
 
18052   puddings
249
 
18054   fetters
250
 
18056   incurring
251
 
18058   pithed
252
 
18060   Miles
253
 
18061   trimmings
254
 
18101   tragedies
255
 
18102   skulking
256
 
18103   flint
257
 
18104   flopping
258
 
18201   relaxing
259
 
18202   offload
260
 
18402   suites
261
 
18403   lists
262
 
18405   multilayer
263
 
18406   standardizes
264
 
18409   Judas
265
 
18601   vacuuming
266
 
18603   humanness
267
 
18801   inch
268
 
18802   Weissmuller
269
 
18803   irresponsibly
270
 
18804   luckily
271
 
18806   medical
272
 
18808   subschema
273
 
18810   Micronesia
274
 
18811   repetitions
275
 
19101   ventilate
276
 
19102   pityingly
277
 
19103   interdependent
278
 
19201   Graves
279
 
30501   neonatal
280
 
30504   honoring
281
 
31901   realtor
282
 
36002   funereal
283
 
36005   sorters
284
 
38002   lectured
285
 
38004   Hawaii
286
 
38006   hushes
287
 
38007   Simla
288
 
38008   reporters
289
 
38011   groupings
290
 
38015   Taoism
291
 
38017   fetched
292
 
38101   rusting
293
 
38102   galling
294
 
38103   obliterates
295
 
38104   traitor
296
 
38201   resumes
297
 
38203   terminator
298
 
38204   gritty
299
 
38205   firearm
300
 
38206   minima
301
 
38208   Selfridge
302
 
42802   witchcraft
303
 
48001   Manhattanize
304
 
48002   imprint
305
 
48003   peeked
306
 
48004   swelling
307
 
48005   interrelationships
308
 
48006   riser
309
 
48007   Gandhian
310
 
48008   peacock
311
 
48102   kanji
312
 
48202   scarf
313
 
48204   insolence
314
 
48205   syndicate
315
 
48302   imperial
316
 
48304   railway
317
 
48305   validate
318
 
48401   normalizes
319
 
48405   schemer
320
 
48407   Kline
321
 
48409   partridges
322
 
48411   recruited
323
 
48602   praised
324
 
48604   linear
325
 
48801   quagmire
326
 
50901   western
327
 
51201   relishing
328
 
56002   serving
329
 
56003   scheduling
330
 
56004   lore
331
 
58004   Fenton
332
 
58101   husky
333
 
58102   impelling
334
 
58103   undoes
335
 
58111   squeezes
336
 
58113   rudeness
337
 
58118   mushrooms
338
 
58121   pellagra
339
 
58124   Huffman
340
 
58125   Majorca
341
 
58126   governing
342
 
58127   gadfly
343
 
58128   reassigned
344
 
58201   intentness
345
 
58303   psychic
346
 
58304   squabbled
347
 
58607   subdirectory
348
 
88302   Gothicism
349
 
88303   feminine
350
 
88305   metaphysically
351
 
88402   sanding
352
 
98025   Miltonism
 
186
012001  flanking
 
187
013602  foldout
 
188
013606  fingerings
 
189
018007  fanatic
 
190
018017  featherweight
 
191
018054  fetters
 
192
018103  flint
 
193
018104  flopping
 
194
036002  funereal
 
195
038017  fetched
 
196
038205  firearm
 
197
058004  Fenton
 
198
088303  feminine
353
199
186002  freakish
354
 
186102  index
355
 
186302  straight
356
200
188007  flurried
357
 
188011  gentleman
358
 
188012  gifted
359
 
188013  Shanghais
360
 
188014  sportswriting
361
 
188015  sloping
362
 
188016  navies
363
 
188017  leaflet
364
 
188102  shooter
365
 
188103  Joplin
366
 
188503  swaying
367
 
188504  Goldstine
368
201
188505  fitting
369
 
190701  Norwalk
370
 
196101  sating
371
 
196103  icon
372
 
196104  throttles
373
 
196203  priceless
374
 
198001  publicly
375
 
198003  incidentals
376
 
198005  mumbles
377
202
198006  furthermore
378
 
198008  parametrized
379
 
198009  registration
380
 
198010  sadly
381
 
198011  positioning
382
 
198014  hoarder
383
 
198017  rains
384
 
198018  workers
385
 
198019  sags
386
 
198020  unplug
387
 
198021  garage
388
 
198024  specifics
389
 
198101  Teresa
390
 
198103  Winsett
391
 
198204  resplendent
392
 
198401  sews
393
 
198402  participated
394
 
198403  Simon
395
203
202301  Fitzpatrick
396
 
202303  misted
397
 
202304  textures
398
 
202305  save
399
 
202602  rightful
400
 
202606  Lizzy
401
 
202904  Hornblower
402
 
202907  vests
403
 
202908  indulgences
404
 
203101  infallibly
405
 
203103  unwilling
406
 
203105  spools
407
 
203402  overestimating
408
 
203404  ineffective
409
 
203901  humiliation
410
 
203902  sophomore
411
 
203903  star
412
 
203906  rifles
413
 
203909  indulge
414
 
206201  languages
415
 
206203  percentage
416
 
206207  specification
417
 
206208  regimented
418
 
208002  pictures
419
 
208003  serpents
420
 
208008  realized
421
 
208009  mayoral
422
 
208010  opaquely
423
 
208011  hostess
424
204
208101  fiftieth
425
 
208102  incorrectly
426
 
208104  stranglings
427
 
208105  mixture
428
 
208111  similarities
429
205
208113  freest
430
 
208201  Greenberg
431
 
208203  tinting
432
 
208302  warm
433
 
208305  smoothed
434
 
208402  Romano
435
 
208501  securing
436
 
208505  heiress
437
 
210101  inform
438
 
210103  universals
439
 
210104  Kinsey
440
 
210105  ravines
441
 
213201  relatively
442
 
213203  pressure
443
 
213206  rightfully
444
 
213207  mechanizing
445
 
216101  Latinizes
446
 
216103  timesharing
447
 
218003  males
448
 
218004  shapelessly
449
 
218006  mastering
450
 
218007  Newtonian
451
206
218008  finishers
452
 
218010  teem
453
 
218011  kiting
454
 
218020  stodgy
455
207
218022  feed
456
 
218023  guitars
457
 
218101  store
458
 
218103  Pyle
459
 
218201  Saxony
460
 
218202  serializations
461
 
218203  Peruvian
462
 
218204  taxonomically
463
 
218205  kingdom
464
 
218301  stint
465
 
218302  Sault
466
208
218401  faithful
467
 
218402  Ganymede
468
 
218403  tidiness
469
 
218404  gainful
470
 
218408  Tipperary
471
 
218409  tropics
472
 
218410  theorizers
473
 
226001  renew
474
 
226003  terminal
475
 
226004  Hegelian
476
 
226005  hypothesizer
477
 
226006  warningly
478
 
226007  journalizing
479
 
226008  nested
480
 
226203  Lars
481
 
226204  saplings
482
209
226205  foothill
483
 
226206  labeled
484
 
226207  imperiously
485
 
226208  reporters
486
210
226209  furnishings
487
 
226210  precipitable
488
 
228004  Stalin
489
 
228006  ripeness
490
 
228008  unruly
491
 
228009  mournfulness
492
 
228108  slaughter
493
 
228109  Sabine
494
 
228110  handy
495
 
228111  rural
496
 
228112  organizer
497
 
228113  shipyard
498
 
228115  inaccuracy
499
 
228116  rules
500
 
228117  juveniles
501
 
228119  investigations
502
 
228120  stabilizes
503
 
228121  seminaries
504
 
228122  Hunter
505
 
228201  sporty
506
 
228206  test
507
 
228207  weasels
508
 
228209  tempering
509
 
228211  Galatean
510
 
228212  techniques
511
 
228214  veranda
512
 
228301  severely
513
211
228306  forthcoming
514
 
228307  guides
515
 
228308  vanish
516
 
228309  lied
517
 
228310  sawtooth
518
212
228311  fated
519
 
228312  gradually
520
 
228313  widens
521
 
228314  preclude
522
 
230302  percentage
523
 
18062   humility
524
 
230501  gleaning
525
 
230502  petted
526
 
230504  minion
527
 
230505  marginal
528
 
230507  measures
529
 
230508  precaution
530
 
230509  repelled
531
 
230901  primary
532
 
230904  navigate
533
 
230905  spatial
534
 
230906  Gurkha
535
 
230907  meanwhile
536
 
230908  Melinda
537
 
230911  previewing
538
 
230912  glut
539
 
230913  unaffected
540
 
230914  inmate
541
 
231304  mineral
542
 
231305  impending
543
 
231306  meditation
544
 
231307  ideas
545
 
231308  miniaturizes
546
 
231309  lewdly
547
 
231310  title
548
 
231311  youthfulness
549
213
231315  freezes
550
214
232102  forgivably
551
 
232103  reduce
552
 
232104  McGovern
553
 
232105  Nazis
554
 
232107  socializes
555
 
232601  Kevin
556
 
232602  uncovering
557
 
232606  raining
558
 
232607  infest
559
 
232609  minting
560
 
236105  roped
561
 
236106  waltz
562
 
236107  Lillian
563
 
236108  repressions
564
 
236110  noncritical
565
 
236111  lithograph
566
 
236112  spongers
567
 
236113  parenthood
568
 
238005  posed
569
 
238006  instruments
570
215
238007  filial
571
216
238008  fixedly
572
 
238009  relives
573
 
238010  Pandora
574
 
238011  watering
575
 
238012  ungrateful
576
 
238013  secures
577
 
228123  poison
578
 
218206  presentation
579
 
150401  Kantian
580
217
select fld3 from t2 where fld3 like "L%" and fld3 = "ok";
581
218
fld3
582
219
select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly");
598
235
250505  bomb
599
236
select distinct companynr from t2;
600
237
companynr
601
 
0
 
238
00
602
239
37
603
240
36
604
241
50
612
249
68
613
250
select distinct companynr from t2 order by companynr;
614
251
companynr
615
 
0
 
252
00
616
253
29
617
254
34
618
255
36
637
274
36
638
275
34
639
276
29
640
 
0
 
277
00
641
278
select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%";
642
279
fld3    period
643
280
obliterates     9410
646
283
organizer       9410
647
284
overestimating  9410
648
285
overlay 9410
649
 
Pandora 9410
650
 
parametrized    9410
651
 
parenthood      9410
652
 
Parsifal        9410
653
 
parters 9410
654
 
participated    9410
655
 
partridges      9410
656
 
peacock 9410
657
 
peeked  9410
658
 
pellagra        9410
659
 
percentage      9410
660
 
persist 9410
661
 
perturb 9410
662
 
Peruvian        9410
663
 
pessimist       9410
664
 
pests   9410
665
 
petted  9410
666
 
pictures        9410
667
 
pithed  9410
668
 
pityingly       9410
669
 
poison  9410
670
 
posed   9410
671
 
positioning     9410
672
 
postulation     9410
673
 
praised 9410
674
 
precaution      9410
675
 
precipitable    9410
676
 
preclude        9410
677
 
presentation    9410
678
 
pressure        9410
679
 
previewing      9410
680
 
priceless       9410
681
 
primary 9410
682
 
psychic 9410
683
 
publicly        9410
684
 
puddings        9410
685
 
Punjab  9410
686
 
Pyle    9410
687
 
quagmire        9410
688
 
quitter 9410
689
 
Quixotism       9410
690
 
railway 9410
691
 
raining 9410
692
 
rains   9410
693
 
ravines 9410
694
 
readable        9410
695
 
realized        9410
696
 
realtor 9410
697
 
reassigned      9410
698
 
recruited       9410
699
 
reduce  9410
700
 
regimented      9410
701
 
registration    9410
702
 
relatively      9410
703
 
relaxing        9410
704
 
relishing       9410
705
 
relives 9410
706
 
renew   9410
707
 
repelled        9410
708
 
repetitions     9410
709
 
reporters       9410
710
 
repressions     9410
711
 
resplendent     9410
712
 
resumes 9410
713
 
rifles  9410
714
 
rightful        9410
715
 
rightfully      9410
716
 
rightfulness    9410
717
 
ripeness        9410
718
 
riser   9410
719
 
Romano  9410
720
 
Romans  9410
721
 
roped   9410
722
 
rudeness        9410
723
 
rules   9410
724
 
rural   9410
725
 
rusting 9410
726
 
Sabine  9410
727
 
sadly   9410
728
 
sags    9410
729
 
sanding 9410
730
 
saplings        9410
731
 
sating  9410
732
 
Sault   9410
733
 
save    9410
734
 
sawtooth        9410
735
 
Saxony  9410
736
 
scarf   9410
737
 
scatterbrain    9410
738
 
scheduling      9410
739
 
schemer 9410
740
 
scholastics     9410
741
 
scornfully      9410
742
 
secures 9410
743
 
securing        9410
744
 
Selfridge       9410
745
 
seminaries      9410
746
 
serializations  9410
747
 
serpents        9410
748
 
serving 9410
749
 
severely        9410
750
 
sews    9410
751
 
Shanghais       9410
752
 
shapelessly     9410
753
 
shipyard        9410
754
 
shooter 9410
755
 
similarities    9410
756
 
Simla   9410
757
 
Simon   9410
758
 
skulking        9410
759
 
slaughter       9410
760
 
sloping 9410
761
 
smoothed        9410
762
 
snatching       9410
763
 
socializes      9410
764
 
sophomore       9410
765
 
sorters 9410
766
 
spatial 9410
767
 
specification   9410
768
 
specifics       9410
769
 
spongers        9410
770
 
spools  9410
771
 
sportswriting   9410
772
 
sporty  9410
773
 
squabbled       9410
774
 
squeaking       9410
775
 
squeezes        9410
776
 
stabilizes      9410
777
 
stairway        9410
778
 
Stalin  9410
779
 
standardizes    9410
780
 
star    9410
781
 
starlet 9410
782
 
stated  9410
783
 
Steinberg       9410
784
 
stint   9410
785
 
stodgy  9410
786
 
store   9410
787
 
straight        9410
788
 
stranglings     9410
789
 
subdirectory    9410
790
 
subjective      9410
791
 
subschema       9410
792
 
succumbed       9410
793
 
suites  9410
794
 
sumac   9410
795
 
sureties        9410
796
 
swaying 9410
797
 
sweetish        9410
798
 
swelling        9410
799
 
syndicate       9410
800
 
Taoism  9410
801
 
taxonomically   9410
802
 
techniques      9410
803
 
teem    9410
804
 
teethe  9410
805
 
tempering       9410
806
 
Teresa  9410
807
 
terminal        9410
808
 
terminator      9410
809
 
terminators     9410
810
 
test    9410
811
 
testicle        9410
812
 
textures        9410
813
 
theorizers      9410
814
 
throttles       9410
815
 
tidiness        9410
816
 
timesharing     9410
817
 
tinily  9410
818
 
tinting 9410
819
 
Tipperary       9410
820
 
title   9410
821
 
tragedies       9410
822
 
traitor 9410
823
 
trimmings       9410
824
 
tropics 9410
825
 
unaffected      9410
826
 
uncovering      9410
827
 
undoes  9410
828
 
ungrateful      9410
829
 
universals      9410
830
 
unplug  9410
831
 
unruly  9410
832
 
untying 9410
833
 
unwilling       9410
834
 
vacuuming       9410
835
 
validate        9410
836
 
vanish  9410
837
 
ventilate       9410
838
 
veranda 9410
839
 
vests   9410
840
 
wallet  9410
841
 
waltz   9410
842
 
warm    9410
843
 
warningly       9410
844
 
watering        9410
845
 
weasels 9410
846
 
Weissmuller     9410
847
 
western 9410
848
 
whiteners       9410
849
 
widens  9410
850
 
Winsett 9410
851
 
witchcraft      9410
852
 
workers 9410
853
 
Wotan   9410
854
 
yelped  9410
855
 
youthfulness    9410
856
286
select distinct fld3 from t2 where companynr = 34 order by fld3;
857
287
fld3
858
288
absentee
1057
487
price2     double(11,0),
1058
488
key (period),
1059
489
key (name)
1060
 
) engine=myisam;
 
490
);
1061
491
create temporary table tmp engine = myisam select * from t3;
1062
492
insert into t3 select * from tmp;
1063
493
insert into tmp select * from t3;
1168
598
explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3;
1169
599
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1170
600
1       SIMPLE  t2      ALL     fld1    NULL    NULL    NULL    1199    Using where; Using temporary; Using filesort
1171
 
1       SIMPLE  t3      eq_ref  PRIMARY PRIMARY 4       test.t2.fld1    1       Using index
 
601
1       SIMPLE  t3      eq_ref  PRIMARY PRIMARY 4       test.t2.fld1    1       Using where; Using index
1172
602
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
1173
603
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1174
604
1       SIMPLE  t1      ALL     period  NULL    NULL    NULL    41810   Using temporary; Using filesort
1849
1279
Wotan   1002    28357832        8723648
1850
1280
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;
1851
1281
fld1    fld3    period  price   price2
1852
 
18201   relaxing        1001    5987435 234724
1853
 
18601   vacuuming       1001    5987435 234724
1854
 
18801   inch    1001    5987435 234724
1855
 
18811   repetitions     1001    5987435 234724
1856
 
19101   ventilate       1001    5987435 234724
1857
 
19201   Graves  1001    5987435 234724
1858
 
30501   neonatal        1001    5987435 234724
1859
 
31901   realtor 1001    5987435 234724
1860
 
36001   elite   1001    5987435 234724
1861
 
38001   Conley  1001    5987435 234724
1862
 
38011   groupings       1001    5987435 234724
1863
 
38101   rusting 1001    5987435 234724
1864
 
38201   resumes 1001    5987435 234724
 
1282
018201  relaxing        1001    5987435 234724
 
1283
018601  vacuuming       1001    5987435 234724
 
1284
018801  inch    1001    5987435 234724
 
1285
018811  repetitions     1001    5987435 234724
1865
1286
create table t4 (
1866
 
companynr int NOT NULL default '00',
 
1287
companynr tinyint(2) unsigned zerofill NOT NULL default '00',
1867
1288
companyname char(30) NOT NULL default '',
1868
1289
PRIMARY KEY (companynr),
1869
1290
UNIQUE KEY companyname(companyname)
1870
1291
) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
1871
1292
select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
1872
1293
companynr       companyname
1873
 
0       Unknown
 
1294
00      Unknown
1874
1295
29      company 1
1875
1296
34      company 2
1876
1297
36      company 3
1884
1305
68      company 10
1885
1306
select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
1886
1307
companynr       companyname
1887
 
0       Unknown
 
1308
00      Unknown
1888
1309
29      company 1
1889
1310
34      company 2
1890
1311
36      company 3
1936
1357
explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
1937
1358
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1938
1359
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1200    
1939
 
1       SIMPLE  t4      eq_ref  PRIMARY PRIMARY 4       test.t2.companynr       1       Using where; Not exists
 
1360
1       SIMPLE  t4      eq_ref  PRIMARY PRIMARY 1       test.t2.companynr       1       Using where; Not exists
1940
1361
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null;
1941
1362
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1942
1363
1       SIMPLE  t4      ALL     NULL    NULL    NULL    NULL    12      
1956
1377
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
1957
1378
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1958
1379
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    Using where
1959
 
1       SIMPLE  t4      eq_ref  PRIMARY PRIMARY 4       test.t2.companynr       1       
 
1380
1       SIMPLE  t4      eq_ref  PRIMARY PRIMARY 1       test.t2.companynr       1       
1960
1381
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
1961
1382
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1962
1383
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    Using where
1963
 
1       SIMPLE  t4      eq_ref  PRIMARY PRIMARY 4       test.t2.companynr       1       
 
1384
1       SIMPLE  t4      eq_ref  PRIMARY PRIMARY 1       test.t2.companynr       1       
1964
1385
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
1965
1386
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1966
1387
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    Using where
1967
 
1       SIMPLE  t4      eq_ref  PRIMARY PRIMARY 4       test.t2.companynr       1       
 
1388
1       SIMPLE  t4      eq_ref  PRIMARY PRIMARY 1       test.t2.companynr       1       
1968
1389
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
1969
1390
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1970
1391
1       SIMPLE  t4      ALL     PRIMARY NULL    NULL    NULL    12      Using where
2007
1428
41      40
2008
1429
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
2009
1430
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
2010
 
1       SIMPLE  t4      index   NULL    PRIMARY 4       NULL    12      Using index; Using temporary
 
1431
1       SIMPLE  t4      index   NULL    PRIMARY 1       NULL    12      Using index; Using temporary
2011
1432
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    1199    Using where; Using join buffer
2012
1433
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;
2013
1434
fld1    companynr       fld3    period
2014
 
38008   37      reporters       1008
2015
 
38208   37      Selfridge       1008
 
1435
038008  37      reporters       1008
 
1436
038208  37      Selfridge       1008
2016
1437
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;
2017
1438
fld1    companynr       fld3    period
2018
 
38008   37      reporters       1008
2019
 
38208   37      Selfridge       1008
 
1439
038008  37      reporters       1008
 
1440
038208  37      Selfridge       1008
2020
1441
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;
2021
1442
fld1    companynr       fld3    period
2022
 
38008   37      reporters       1008
2023
 
38208   37      Selfridge       1008
 
1443
038008  37      reporters       1008
 
1444
038208  37      Selfridge       1008
2024
1445
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);
2025
1446
period
2026
1447
9410
2058
1479
1
2059
1480
select companynr,count(*),sum(fld1) from t2 group by companynr;
2060
1481
companynr       count(*)        sum(fld1)
2061
 
0       82      10355753
 
1482
00      82      10355753
2062
1483
29      95      14473298
2063
1484
34      70      17788966
2064
1485
36      215     22786296
2087
1508
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` <> ''))
2088
1509
select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3;
2089
1510
companynr       count(*)        min(fld4)       max(fld4)       sum(fld1)       avg(fld1)       std(fld1)       variance(fld1)
2090
 
0       82      Anthony windmills       10355753        126289.6707     115550.9757     13352027981.7087
 
1511
00      82      Anthony windmills       10355753        126289.6707     115550.9757     13352027981.7087
2091
1512
29      95      abut    wetness 14473298        152350.5053     8368.5480       70032594.9026
2092
1513
34      70      absentee        vest    17788966        254128.0857     3272.5940       10709871.3069
2093
1514
select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
2142
1563
1199
2143
1564
select companynr,count(distinct fld1) from t2 group by companynr;
2144
1565
companynr       count(distinct fld1)
2145
 
0       82
 
1566
00      82
2146
1567
29      95
2147
1568
34      70
2148
1569
36      215
2156
1577
68      12
2157
1578
select companynr,count(*) from t2 group by companynr;
2158
1579
companynr       count(*)
2159
 
0       82
 
1580
00      82
2160
1581
29      95
2161
1582
34      70
2162
1583
36      215
2170
1591
68      12
2171
1592
select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr;
2172
1593
companynr       count(distinct concat(fld1,repeat(65,1000)))
2173
 
0       82
 
1594
00      82
2174
1595
29      95
2175
1596
34      70
2176
1597
36      215
2184
1605
68      12
2185
1606
select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr;
2186
1607
companynr       count(distinct concat(fld1,repeat(65,200)))
2187
 
0       82
 
1608
00      82
2188
1609
29      95
2189
1610
34      70
2190
1611
36      215
2198
1619
68      12
2199
1620
select companynr,count(distinct floor(fld1/100)) from t2 group by companynr;
2200
1621
companynr       count(distinct floor(fld1/100))
2201
 
0       47
 
1622
00      47
2202
1623
29      35
2203
1624
34      14
2204
1625
36      69
2212
1633
68      1
2213
1634
select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr;
2214
1635
companynr       count(distinct concat(repeat(65,1000),floor(fld1/100)))
2215
 
0       47
 
1636
00      47
2216
1637
29      35
2217
1638
34      14
2218
1639
36      69
2251
1672
select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
2252
1673
fld3    count(*)
2253
1674
spates  4181
2254
 
select companynr,companyname from t4 group by 1;
2255
 
companynr       companyname
 
1675
select companynr|0,companyname from t4 group by 1;
 
1676
companynr|0     companyname
2256
1677
0       Unknown
2257
1678
29      company 1
2258
1679
34      company 2
2278
1699
53      company 7       4
2279
1700
58      company 8       23
2280
1701
65      company 9       10
2281
 
0       Unknown 82
 
1702
00      Unknown 82
2282
1703
select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
2283
1704
fld1    count(*)
2284
1705
158402  4181
2302
1723
37      588
2303
1724
36      215
2304
1725
29      95
2305
 
0       82
 
1726
00      82
2306
1727
34      70
2307
1728
41      52
2308
1729
40      37
2321
1742
53      4
2322
1743
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;
2323
1744
fld4    fld1    count(price)    sum(price)      min(price)      max(price)      avg(price)
2324
 
teethe  1       1       5987435 5987435 5987435 5987435.0000
2325
 
dreaded 11401   1       5987435 5987435 5987435 5987435.0000
2326
 
scholastics     11402   1       28357832        28357832        28357832        28357832.0000
2327
 
audiology       11403   1       39654943        39654943        39654943        39654943.0000
2328
 
wallet  11501   1       5987435 5987435 5987435 5987435.0000
2329
 
parters 11701   1       5987435 5987435 5987435 5987435.0000
2330
 
eschew  11702   1       28357832        28357832        28357832        28357832.0000
2331
 
quitter 11703   1       39654943        39654943        39654943        39654943.0000
2332
 
neat    12001   1       5987435 5987435 5987435 5987435.0000
2333
 
Steinberg       12003   1       39654943        39654943        39654943        39654943.0000
2334
 
balled  12301   1       5987435 5987435 5987435 5987435.0000
2335
 
persist 12302   1       28357832        28357832        28357832        28357832.0000
2336
 
attainments     12303   1       39654943        39654943        39654943        39654943.0000
2337
 
capably 12501   1       5987435 5987435 5987435 5987435.0000
2338
 
impulsive       12602   1       28357832        28357832        28357832        28357832.0000
2339
 
starlet 12603   1       39654943        39654943        39654943        39654943.0000
2340
 
featherweight   12701   1       5987435 5987435 5987435 5987435.0000
2341
 
pessimist       12702   1       28357832        28357832        28357832        28357832.0000
2342
 
daughter        12703   1       39654943        39654943        39654943        39654943.0000
2343
 
lawgiver        13601   1       5987435 5987435 5987435 5987435.0000
2344
 
stated  13602   1       28357832        28357832        28357832        28357832.0000
2345
 
readable        13603   1       39654943        39654943        39654943        39654943.0000
2346
 
testicle        13801   1       5987435 5987435 5987435 5987435.0000
2347
 
Parsifal        13802   1       28357832        28357832        28357832        28357832.0000
2348
 
leavings        13803   1       39654943        39654943        39654943        39654943.0000
2349
 
squeaking       13901   1       5987435 5987435 5987435 5987435.0000
2350
 
contrasted      16001   1       5987435 5987435 5987435 5987435.0000
2351
 
leftover        16201   1       5987435 5987435 5987435 5987435.0000
2352
 
whiteners       16202   1       28357832        28357832        28357832        28357832.0000
2353
 
erases  16301   1       5987435 5987435 5987435 5987435.0000
2354
 
Punjab  16302   1       28357832        28357832        28357832        28357832.0000
2355
 
Merritt 16303   1       39654943        39654943        39654943        39654943.0000
2356
 
sweetish        18001   1       5987435 5987435 5987435 5987435.0000
2357
 
dogging 18002   1       28357832        28357832        28357832        28357832.0000
2358
 
scornfully      18003   1       39654943        39654943        39654943        39654943.0000
2359
 
fetters 18012   1       28357832        28357832        28357832        28357832.0000
2360
 
bivalves        18013   1       39654943        39654943        39654943        39654943.0000
2361
 
skulking        18021   1       5987435 5987435 5987435 5987435.0000
2362
 
flint   18022   1       28357832        28357832        28357832        28357832.0000
2363
 
flopping        18023   1       39654943        39654943        39654943        39654943.0000
2364
 
Judas   18032   1       28357832        28357832        28357832        28357832.0000
2365
 
vacuuming       18033   1       39654943        39654943        39654943        39654943.0000
2366
 
medical 18041   1       5987435 5987435 5987435 5987435.0000
2367
 
bloodbath       18042   1       28357832        28357832        28357832        28357832.0000
2368
 
subschema       18043   1       39654943        39654943        39654943        39654943.0000
2369
 
interdependent  18051   1       5987435 5987435 5987435 5987435.0000
2370
 
Graves  18052   1       28357832        28357832        28357832        28357832.0000
2371
 
neonatal        18053   1       39654943        39654943        39654943        39654943.0000
2372
 
sorters 18061   1       5987435 5987435 5987435 5987435.0000
2373
 
epistle 18062   1       28357832        28357832        28357832        28357832.0000
2374
 
Conley  18101   1       5987435 5987435 5987435 5987435.0000
2375
 
lectured        18102   1       28357832        28357832        28357832        28357832.0000
2376
 
Abraham 18103   1       39654943        39654943        39654943        39654943.0000
2377
 
cage    18201   1       5987435 5987435 5987435 5987435.0000
2378
 
hushes  18202   1       28357832        28357832        28357832        28357832.0000
2379
 
Simla   18402   1       28357832        28357832        28357832        28357832.0000
2380
 
reporters       18403   1       39654943        39654943        39654943        39654943.0000
2381
 
coexist 18601   1       5987435 5987435 5987435 5987435.0000
2382
 
Beebe   18602   1       28357832        28357832        28357832        28357832.0000
2383
 
Taoism  18603   1       39654943        39654943        39654943        39654943.0000
2384
 
Connally        18801   1       5987435 5987435 5987435 5987435.0000
2385
 
fetched 18802   1       28357832        28357832        28357832        28357832.0000
2386
 
checkpoints     18803   1       39654943        39654943        39654943        39654943.0000
2387
 
gritty  18811   1       5987435 5987435 5987435 5987435.0000
2388
 
firearm 18812   1       28357832        28357832        28357832        28357832.0000
2389
 
minima  19101   1       5987435 5987435 5987435 5987435.0000
2390
 
Selfridge       19102   1       28357832        28357832        28357832        28357832.0000
2391
 
disable 19103   1       39654943        39654943        39654943        39654943.0000
2392
 
witchcraft      19201   1       5987435 5987435 5987435 5987435.0000
2393
 
betroth 30501   1       5987435 5987435 5987435 5987435.0000
2394
 
Manhattanize    30502   1       28357832        28357832        28357832        28357832.0000
2395
 
imprint 30503   1       39654943        39654943        39654943        39654943.0000
2396
 
swelling        31901   1       5987435 5987435 5987435 5987435.0000
2397
 
interrelationships      36001   1       5987435 5987435 5987435 5987435.0000
2398
 
riser   36002   1       28357832        28357832        28357832        28357832.0000
2399
 
bee     38001   1       5987435 5987435 5987435 5987435.0000
2400
 
kanji   38002   1       28357832        28357832        28357832        28357832.0000
2401
 
dental  38003   1       39654943        39654943        39654943        39654943.0000
2402
 
railway 38011   1       5987435 5987435 5987435 5987435.0000
2403
 
validate        38012   1       28357832        28357832        28357832        28357832.0000
2404
 
normalizes      38013   1       39654943        39654943        39654943        39654943.0000
2405
 
Kline   38101   1       5987435 5987435 5987435 5987435.0000
2406
 
Anatole 38102   1       28357832        28357832        28357832        28357832.0000
2407
 
partridges      38103   1       39654943        39654943        39654943        39654943.0000
2408
 
recruited       38201   1       5987435 5987435 5987435 5987435.0000
2409
 
dimensions      38202   1       28357832        28357832        28357832        28357832.0000
2410
 
Chicana 38203   1       39654943        39654943        39654943        39654943.0000
 
1745
teethe  000001  1       5987435 5987435 5987435 5987435.0000
 
1746
dreaded 011401  1       5987435 5987435 5987435 5987435.0000
 
1747
scholastics     011402  1       28357832        28357832        28357832        28357832.0000
 
1748
audiology       011403  1       39654943        39654943        39654943        39654943.0000
 
1749
wallet  011501  1       5987435 5987435 5987435 5987435.0000
 
1750
parters 011701  1       5987435 5987435 5987435 5987435.0000
 
1751
eschew  011702  1       28357832        28357832        28357832        28357832.0000
 
1752
quitter 011703  1       39654943        39654943        39654943        39654943.0000
 
1753
neat    012001  1       5987435 5987435 5987435 5987435.0000
 
1754
Steinberg       012003  1       39654943        39654943        39654943        39654943.0000
 
1755
balled  012301  1       5987435 5987435 5987435 5987435.0000
 
1756
persist 012302  1       28357832        28357832        28357832        28357832.0000
 
1757
attainments     012303  1       39654943        39654943        39654943        39654943.0000
 
1758
capably 012501  1       5987435 5987435 5987435 5987435.0000
 
1759
impulsive       012602  1       28357832        28357832        28357832        28357832.0000
 
1760
starlet 012603  1       39654943        39654943        39654943        39654943.0000
 
1761
featherweight   012701  1       5987435 5987435 5987435 5987435.0000
 
1762
pessimist       012702  1       28357832        28357832        28357832        28357832.0000
 
1763
daughter        012703  1       39654943        39654943        39654943        39654943.0000
 
1764
lawgiver        013601  1       5987435 5987435 5987435 5987435.0000
 
1765
stated  013602  1       28357832        28357832        28357832        28357832.0000
 
1766
readable        013603  1       39654943        39654943        39654943        39654943.0000
 
1767
testicle        013801  1       5987435 5987435 5987435 5987435.0000
 
1768
Parsifal        013802  1       28357832        28357832        28357832        28357832.0000
 
1769
leavings        013803  1       39654943        39654943        39654943        39654943.0000
 
1770
squeaking       013901  1       5987435 5987435 5987435 5987435.0000
 
1771
contrasted      016001  1       5987435 5987435 5987435 5987435.0000
 
1772
leftover        016201  1       5987435 5987435 5987435 5987435.0000
 
1773
whiteners       016202  1       28357832        28357832        28357832        28357832.0000
 
1774
erases  016301  1       5987435 5987435 5987435 5987435.0000
 
1775
Punjab  016302  1       28357832        28357832        28357832        28357832.0000
 
1776
Merritt 016303  1       39654943        39654943        39654943        39654943.0000
 
1777
sweetish        018001  1       5987435 5987435 5987435 5987435.0000
 
1778
dogging 018002  1       28357832        28357832        28357832        28357832.0000
 
1779
scornfully      018003  1       39654943        39654943        39654943        39654943.0000
 
1780
fetters 018012  1       28357832        28357832        28357832        28357832.0000
 
1781
bivalves        018013  1       39654943        39654943        39654943        39654943.0000
 
1782
skulking        018021  1       5987435 5987435 5987435 5987435.0000
 
1783
flint   018022  1       28357832        28357832        28357832        28357832.0000
 
1784
flopping        018023  1       39654943        39654943        39654943        39654943.0000
 
1785
Judas   018032  1       28357832        28357832        28357832        28357832.0000
 
1786
vacuuming       018033  1       39654943        39654943        39654943        39654943.0000
 
1787
medical 018041  1       5987435 5987435 5987435 5987435.0000
 
1788
bloodbath       018042  1       28357832        28357832        28357832        28357832.0000
 
1789
subschema       018043  1       39654943        39654943        39654943        39654943.0000
 
1790
interdependent  018051  1       5987435 5987435 5987435 5987435.0000
 
1791
Graves  018052  1       28357832        28357832        28357832        28357832.0000
 
1792
neonatal        018053  1       39654943        39654943        39654943        39654943.0000
 
1793
sorters 018061  1       5987435 5987435 5987435 5987435.0000
 
1794
epistle 018062  1       28357832        28357832        28357832        28357832.0000
 
1795
Conley  018101  1       5987435 5987435 5987435 5987435.0000
 
1796
lectured        018102  1       28357832        28357832        28357832        28357832.0000
 
1797
Abraham 018103  1       39654943        39654943        39654943        39654943.0000
 
1798
cage    018201  1       5987435 5987435 5987435 5987435.0000
 
1799
hushes  018202  1       28357832        28357832        28357832        28357832.0000
 
1800
Simla   018402  1       28357832        28357832        28357832        28357832.0000
 
1801
reporters       018403  1       39654943        39654943        39654943        39654943.0000
 
1802
coexist 018601  1       5987435 5987435 5987435 5987435.0000
 
1803
Beebe   018602  1       28357832        28357832        28357832        28357832.0000
 
1804
Taoism  018603  1       39654943        39654943        39654943        39654943.0000
 
1805
Connally        018801  1       5987435 5987435 5987435 5987435.0000
 
1806
fetched 018802  1       28357832        28357832        28357832        28357832.0000
 
1807
checkpoints     018803  1       39654943        39654943        39654943        39654943.0000
 
1808
gritty  018811  1       5987435 5987435 5987435 5987435.0000
 
1809
firearm 018812  1       28357832        28357832        28357832        28357832.0000
 
1810
minima  019101  1       5987435 5987435 5987435 5987435.0000
 
1811
Selfridge       019102  1       28357832        28357832        28357832        28357832.0000
 
1812
disable 019103  1       39654943        39654943        39654943        39654943.0000
 
1813
witchcraft      019201  1       5987435 5987435 5987435 5987435.0000
 
1814
betroth 030501  1       5987435 5987435 5987435 5987435.0000
 
1815
Manhattanize    030502  1       28357832        28357832        28357832        28357832.0000
 
1816
imprint 030503  1       39654943        39654943        39654943        39654943.0000
 
1817
swelling        031901  1       5987435 5987435 5987435 5987435.0000
 
1818
interrelationships      036001  1       5987435 5987435 5987435 5987435.0000
 
1819
riser   036002  1       28357832        28357832        28357832        28357832.0000
 
1820
bee     038001  1       5987435 5987435 5987435 5987435.0000
 
1821
kanji   038002  1       28357832        28357832        28357832        28357832.0000
 
1822
dental  038003  1       39654943        39654943        39654943        39654943.0000
 
1823
railway 038011  1       5987435 5987435 5987435 5987435.0000
 
1824
validate        038012  1       28357832        28357832        28357832        28357832.0000
 
1825
normalizes      038013  1       39654943        39654943        39654943        39654943.0000
 
1826
Kline   038101  1       5987435 5987435 5987435 5987435.0000
 
1827
Anatole 038102  1       28357832        28357832        28357832        28357832.0000
 
1828
partridges      038103  1       39654943        39654943        39654943        39654943.0000
 
1829
recruited       038201  1       5987435 5987435 5987435 5987435.0000
 
1830
dimensions      038202  1       28357832        28357832        28357832        28357832.0000
 
1831
Chicana 038203  1       39654943        39654943        39654943        39654943.0000
2411
1832
select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3;
2412
1833
companynr       fld3    sum(price)
2413
1834
512     boat    786542
2422
1843
512     skies   786542
2423
1844
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;
2424
1845
companynr       count(*)        min(fld3)       max(fld3)       sum(price)      avg(price)
2425
 
0       1       Omaha   Omaha   5987435 5987435.0000
 
1846
00      1       Omaha   Omaha   5987435 5987435.0000
2426
1847
36      1       dubbed  dubbed  28357832        28357832.0000
2427
1848
37      83      Abraham Wotan   1908978016      22999735.1325
2428
1849
50      2       scribbled       tapestry        68012775        34006387.5000
2520
1941
234298
2521
1942
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;
2522
1943
fld1    sum(price)
2523
 
38008   234298
 
1944
038008  234298
2524
1945
explain select fld3 from t2 where 1>2 or 2>3;
2525
1946
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
2526
1947
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE
2537
1958
34      250502
2538
1959
select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000;
2539
1960
companynr       count   sum
2540
 
0       82      10355753
 
1961
00      82      10355753
2541
1962
29      95      14473298
2542
1963
34      70      17788966
2543
1964
37      588     83602098
2544
1965
41      52      12816335
2545
1966
select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ;
2546
1967
companynr
2547
 
0
 
1968
00
2548
1969
29
2549
1970
34
2550
1971
37
2646
2067
Tables_in_test (t?)
2647
2068
show full columns from t2;
2648
2069
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
2649
 
auto    int     NULL    NO      PRI     NULL    auto_increment  #       
2650
 
fld1    int     NULL    NO      UNI     NULL            #       
2651
 
companynr       int     NULL    NO              NULL            #       
2652
 
fld3    varchar(30)     utf8_general_ci NO      MUL     NULL            #       
2653
 
fld4    varchar(35)     utf8_general_ci NO              NULL            #       
2654
 
fld5    varchar(35)     utf8_general_ci NO              NULL            #       
2655
 
fld6    varchar(4)      utf8_general_ci NO              NULL            #       
 
2070
auto    int(11) NULL    NO      PRI     NULL    auto_increment  #       
 
2071
fld1    int(6) unsigned zerofill        NULL    NO      UNI     000000          #       
 
2072
companynr       tinyint(2) unsigned zerofill    NULL    NO              00              #       
 
2073
fld3    char(30)        latin1_swedish_ci       NO      MUL                     #       
 
2074
fld4    char(35)        latin1_swedish_ci       NO                              #       
 
2075
fld5    char(35)        latin1_swedish_ci       NO                              #       
 
2076
fld6    char(4) latin1_swedish_ci       NO                              #       
2656
2077
show full columns from t2 from test like 'f%';
2657
2078
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
2658
 
fld1    int     NULL    NO      UNI     NULL            #       
2659
 
fld3    varchar(30)     utf8_general_ci NO      MUL     NULL            #       
2660
 
fld4    varchar(35)     utf8_general_ci NO              NULL            #       
2661
 
fld5    varchar(35)     utf8_general_ci NO              NULL            #       
2662
 
fld6    varchar(4)      utf8_general_ci NO              NULL            #       
 
2079
fld1    int(6) unsigned zerofill        NULL    NO      UNI     000000          #       
 
2080
fld3    char(30)        latin1_swedish_ci       NO      MUL                     #       
 
2081
fld4    char(35)        latin1_swedish_ci       NO                              #       
 
2082
fld5    char(35)        latin1_swedish_ci       NO                              #       
 
2083
fld6    char(4) latin1_swedish_ci       NO                              #       
2663
2084
show full columns from t2 from test like 's%';
2664
2085
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
2665
2086
show keys from t2;
2669
2090
t2      1       fld3    1       fld3    A       NULL    NULL    NULL            BTREE           
2670
2091
drop table t4, t3, t2, t1;
2671
2092
CREATE TABLE t1 (
2672
 
cont_nr int NOT NULL auto_increment,
2673
 
ver_nr int NOT NULL default '0',
2674
 
aufnr int NOT NULL default '0',
 
2093
cont_nr int(11) NOT NULL auto_increment,
 
2094
ver_nr int(11) NOT NULL default '0',
 
2095
aufnr int(11) NOT NULL default '0',
2675
2096
username varchar(50) NOT NULL default '',
2676
 
hdl_nr int NOT NULL default '0',
 
2097
hdl_nr int(11) NOT NULL default '0',
2677
2098
eintrag date NOT NULL default '0000-00-00',
2678
2099
st_klasse varchar(40) NOT NULL default '',
2679
2100
st_wert varchar(40) NOT NULL default '',
2680
2101
st_zusatz varchar(40) NOT NULL default '',
2681
2102
st_bemerkung varchar(255) NOT NULL default '',
2682
2103
kunden_art varchar(40) NOT NULL default '',
2683
 
mcbs_knr int default NULL,
2684
 
mcbs_aufnr int NOT NULL default '0',
 
2104
mcbs_knr int(11) default NULL,
 
2105
mcbs_aufnr int(11) NOT NULL default '0',
2685
2106
schufa_status char(1) default '?',
2686
2107
bemerkung text,
2687
2108
wirknetz text,
2688
 
wf_igz int NOT NULL default '0',
 
2109
wf_igz int(11) NOT NULL default '0',
2689
2110
tarifcode varchar(80) default NULL,
2690
2111
recycle char(1) default NULL,
2691
2112
sim varchar(30) default NULL,
2692
2113
mcbs_tpl varchar(30) default NULL,
2693
 
emp_nr int NOT NULL default '0',
2694
 
laufzeit int default NULL,
 
2114
emp_nr int(11) NOT NULL default '0',
 
2115
laufzeit int(11) default NULL,
2695
2116
hdl_name varchar(30) default NULL,
2696
 
prov_hdl_nr int NOT NULL default '0',
 
2117
prov_hdl_nr int(11) NOT NULL default '0',
2697
2118
auto_wirknetz varchar(50) default NULL,
2698
2119
auto_billing varchar(50) default NULL,
2699
2120
touch timestamp NOT NULL,