|
|
SHOW STATUS LIKE 'Ssl_cipher';Variable_name ValueSsl_cipher DHE-RSA-AES256-SHASHOW STATUS LIKE 'Compression';Variable_name ValueCompression ONdrop table if exists t1,t2,t3,t4;CREATE TABLE t1 (Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL);INSERT INTO t1 VALUES (9410,9412);select period from t1;period9410select * from t1;Period Varor_period9410 9412select t1.* from t1;Period Varor_period9410 9412CREATE TABLE t2 (auto int not null auto_increment,fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,fld3 char(30) DEFAULT '' NOT NULL,fld4 char(35) DEFAULT '' NOT NULL,fld5 char(35) DEFAULT '' NOT NULL,fld6 char(4) DEFAULT '' NOT NULL,UNIQUE fld1 (fld1),KEY fld3 (fld3),PRIMARY KEY (auto));select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";fld3imaginableselect fld3 from t2 where fld3 like "%cultivation" ;fld3cultivationselect t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;fld3 companynrconcoct 58druggists 58engrossing 58Eurydice 58exclaimers 58ferociousness 58hopelessness 58Huey 58imaginable 58judges 58merging 58ostrich 58peering 58Phelps 58presumes 58Ruth 58sentences 58Shylock 58straggled 58synergy 58thanking 58tying 58unlocks 58select fld3,companynr from t2 where companynr = 58 order by fld3;fld3 companynrconcoct 58druggists 58engrossing 58Eurydice 58exclaimers 58ferociousness 58hopelessness 58Huey 58imaginable 58judges 58merging 58ostrich 58peering 58Phelps 58presumes 58Ruth 58sentences 58Shylock 58straggled 58synergy 58thanking 58tying 58unlocks 58select fld3 from t2 order by fld3 desc limit 10;fld3youthfulnessyelpedWotanworkersWittwitchcraftWinsettWillywilledwildcatsselect fld3 from t2 order by fld3 desc limit 5;fld3youthfulnessyelpedWotanworkersWittselect fld3 from t2 order by fld3 desc limit 5,5;fld3witchcraftWinsettWillywilledwildcatsselect t2.fld3 from t2 where fld3 = 'honeysuckle';fld3honeysuckleselect t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';fld3honeysuckleselect t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';fld3honeysuckleselect t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';fld3honeysuckleselect t2.fld3 from t2 where fld3 LIKE 'h%le';fld3honeysuckleselect t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';fld3select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';fld3explain select t2.fld3 from t2 where fld3 = 'honeysuckle';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using indexexplain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using whereexplain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using whereexplain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using indexexplain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using indexexplain select fld3 from t2 ignore index (fld3,not_used);ERROR 42000: Key column 'not_used' doesn't exist in tableexplain select fld3 from t2 use index (not_used);ERROR 42000: Key column 'not_used' doesn't exist in tableselect t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;fld3honeysucklehonoringexplain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 range fld3 fld3 30 NULL 2 Using where; Using indexselect fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;fld1 fld3148504 Colombo068305 Colombo000000 nondecreasingselect fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes';fld1 fld3232605 appendixes1232605 appendixes1232606 appendixes1232607 appendixes1232608 appendixes1232609 appendixesselect fld1 from t2 where fld1=250501 or fld1="250502";fld1250501250502explain select fld1 from t2 where fld1=250501 or fld1="250502";id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using indexselect fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;fld1250501250502250505250601explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 range fld1 fld1 4 NULL 4 Using where; Using indexselect fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%';fld1 fld3218401 faithful018007 fanatic228311 fated018017 featherweight218022 feed088303 feminine058004 Fenton038017 fetched018054 fetters208101 fiftieth238007 filial013606 fingerings218008 finishers038205 firearm188505 fitting202301 Fitzpatrick238008 fixedly012001 flanking018103 flint018104 flopping188007 flurried013602 foldout226205 foothill232102 forgivably228306 forthcoming186002 freakish208113 freest231315 freezes036002 funereal226209 furnishings198006 furthermoreselect fld3 from t2 where fld3 like "L%" and fld3 = "ok";fld3select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly");fld3Chantillyselect fld1,fld3 from t2 where fld1 like "25050%";fld1 fld3250501 poisoning250502 Iraqis250503 heaving250504 population250505 bombselect fld1,fld3 from t2 where fld1 like "25050_";fld1 fld3250501 poisoning250502 Iraqis250503 heaving250504 population250505 bombselect distinct companynr from t2;companynr003736505829405365413468select distinct companynr from t2 order by companynr;companynr002934363740415053586568select distinct companynr from t2 order by companynr desc;companynr686558535041403736342900select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%";fld3 periodobliterates 9410offload 9410opaquely 9410organizer 9410overestimating 9410overlay 9410select distinct fld3 from t2 where companynr = 34 order by fld3;fld3absenteeaccessedaheadalphabeticAsiaticizationsattitudeayebankruptciesbelaysBlythebombboulevardbulldozescannotcaressingcharcoalchecksummingchessclubroomcolorfulcosycreatorcryingDariusdiffusingdualityEiffelEpiphanyErnestineexplorersexterminatedfamineforkedGershwinsheavingHodgesIraqisItalianizationLagoslandslidelibrettoMajorcamasteringnarrowedoccurredofferersPalestinePeruvianizespharmaceuticpoisoningpopulationPygmalionratsrealestrecordingregimentedretransmittingreviverrousesscarssickersleepwalkstoppedsugarstranslatableunclesunexpecteduprisingsversatilityvestselect distinct fld3 from t2 limit 10;fld3abatesabidingAbrahamabrogatingabsenteeabutaccessedaccruingaccumulatingaccuraciesselect distinct fld3 from t2 having fld3 like "A%" limit 10;fld3abatesabidingAbrahamabrogatingabsenteeabutaccessedaccruingaccumulatingaccuraciesselect distinct substring(fld3,1,3) from t2 where fld3 like "A%";substring(fld3,1,3)abaabiAbrabsabuaccacqacuAdeadjAdladmAdoadsadvaeraffafiaflafoagiaheaimairAldalgaliallalpalramaameammanaandaneAnganiAnnAntapiappaquAraarcArmarrArtAsiaskaspassastattaudAugautaveavoaweayeAztselect distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10;aabaabiAbrabsabuaccacqacuAdeadjselect distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10;substring(fld3,1,3)abaabiAbrabsabuaccacqacuAdeadjselect distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10;aabaabiAbrabsabuaccacqacuAdeadjcreate table t3 (period int not null,name char(32) not null,companynr int not null,price double(11,0),price2 double(11,0),key (period),key (name));create temporary table tmp engine = myisam select * from t3;insert into t3 select * from tmp;insert into tmp select * from t3;insert into t3 select * from tmp;insert into tmp select * from t3;insert into t3 select * from tmp;insert into tmp select * from t3;insert into t3 select * from tmp;insert into tmp select * from t3;insert into t3 select * from tmp;insert into tmp select * from t3;insert into t3 select * from tmp;insert into tmp select * from t3;insert into t3 select * from tmp;insert into tmp select * from t3;insert into t3 select * from tmp;insert into tmp select * from t3;insert into t3 select * from tmp;alter table t3 add t2nr int not null auto_increment primary key first;drop table tmp;SET SQL_BIG_TABLES=1;select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10;namnAbraham Abrahamabrogating abrogatingadmonishing admonishingAdolph Adolphafield afieldaging agingammonium ammoniumanalyzable analyzableanimals animalsanimized animizedSET SQL_BIG_TABLES=0;select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10;concat(fld3," ",fld3)Abraham Abrahamabrogating abrogatingadmonishing admonishingAdolph Adolphafield afieldaging agingammonium ammoniumanalyzable analyzableanimals animalsanimized animizedselect distinct fld5 from t2 limit 10;fld5neatSteinbergjarringtinilyballedpersistattainmentsfanaticmeasuresrightfulnessselect distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;fld3 count(*)affixed 1and 1annoyers 1Anthony 1assayed 1assurers 1attendants 1bedlam 1bedpost 1boasted 1SET SQL_BIG_TABLES=1;select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;fld3 count(*)affixed 1and 1annoyers 1Anthony 1assayed 1assurers 1attendants 1bedlam 1bedpost 1boasted 1SET SQL_BIG_TABLES=0;select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10;fld3 repeat("a",length(fld3)) count(*)circus aaaaaa 1cited aaaaa 1Colombo aaaaaaa 1congresswoman aaaaaaaaaaaaa 1contrition aaaaaaaaaa 1corny aaaaa 1cultivation aaaaaaaaaaa 1definiteness aaaaaaaaaaaa 1demultiplex aaaaaaaaaaa 1disappointing aaaaaaaaaaaaa 1select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2;companynr rtrim(space(512+companynr))37 78 101 154 311 447 512 select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3;fld3explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using indexexplain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort1 SIMPLE t3 ref period period 4 test.t1.period 4181 explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t3 index period period 4 NULL 41810 1 SIMPLE t1 ref period period 4 test.t3.period 4181 explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 index period period 4 NULL 41810 1 SIMPLE t3 ref period period 4 test.t1.period 4181 select period from t1;period9410select period from t1 where period=1900;periodselect fld3,period from t1,t2 where fld1 = 011401 order by period;fld3 periodbreaking 9410select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001;fld3 periodbreaking 1001explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 const fld1 fld1 4 const 1 1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1 select fld3,period from t2,t1 where companynr*10 = 37*10;fld3 periodbreaking 9410Romans 9410intercepted 9410bewilderingly 9410astound 9410admonishing 9410sumac 9410flanking 9410combed 9410subjective 9410scatterbrain 9410Eulerian 9410Kane 9410overlay 9410perturb 9410goblins 9410annihilates 9410Wotan 9410snatching 9410concludes 9410laterally 9410yelped 9410grazing 9410Baird 9410celery 9410misunderstander 9410handgun 9410foldout 9410mystic 9410succumbed 9410Nabisco 9410fingerings 9410aging 9410afield 9410ammonium 9410boat 9410intelligibility 9410Augustine 9410teethe 9410dreaded 9410scholastics 9410audiology 9410wallet 9410parters 9410eschew 9410quitter 9410neat 9410Steinberg 9410jarring 9410tinily 9410balled 9410persist 9410attainments 9410fanatic 9410measures 9410rightfulness 9410capably 9410impulsive 9410starlet 9410terminators 9410untying 9410announces 9410featherweight 9410pessimist 9410daughter 9410decliner 9410lawgiver 9410stated 9410readable 9410attrition 9410cascade 9410motors 9410interrogate 9410pests 9410stairway 9410dopers 9410testicle 9410Parsifal 9410leavings 9410postulation 9410squeaking 9410contrasted 9410leftover 9410whiteners 9410erases 9410Punjab 9410Merritt 9410Quixotism 9410sweetish 9410dogging 9410scornfully 9410bellow 9410bills 9410cupboard 9410sureties 9410puddings 9410fetters 9410bivalves 9410incurring 9410Adolph 9410pithed 9410Miles 9410trimmings 9410tragedies 9410skulking 9410flint 9410flopping 9410relaxing 9410offload 9410suites 9410lists 9410animized 9410multilayer 9410standardizes 9410Judas 9410vacuuming 9410dentally 9410humanness 9410inch 9410Weissmuller 9410irresponsibly 9410luckily 9410culled 9410medical 9410bloodbath 9410subschema 9410animals 9410Micronesia 9410repetitions 9410Antares 9410ventilate 9410pityingly 9410interdependent 9410Graves 9410neonatal 9410chafe 9410honoring 9410realtor 9410elite 9410funereal 9410abrogating 9410sorters 9410Conley 9410lectured 9410Abraham 9410Hawaii 9410cage 9410hushes 9410Simla 9410reporters 9410Dutchman 9410descendants 9410groupings 9410dissociate 9410coexist 9410Beebe 9410Taoism 9410Connally 9410fetched 9410checkpoints 9410rusting 9410galling 9410obliterates 9410traitor 9410resumes 9410analyzable 9410terminator 9410gritty 9410firearm 9410minima 9410Selfridge 9410disable 9410witchcraft 9410betroth 9410Manhattanize 9410imprint 9410peeked 9410swelling 9410interrelationships 9410riser 9410Gandhian 9410peacock 9410bee 9410kanji 9410dental 9410scarf 9410chasm 9410insolence 9410syndicate 9410alike 9410imperial 9410convulsion 9410railway 9410validate 9410normalizes 9410comprehensive 9410chewing 9410denizen 9410schemer 9410chronicle 9410Kline 9410Anatole 9410partridges 9410brunch 9410recruited 9410dimensions 9410Chicana 9410announced 9410praised 9410employing 9410linear 9410quagmire 9410western 9410relishing 9410serving 9410scheduling 9410lore 9410eventful 9410arteriole 9410disentangle 9410cured 9410Fenton 9410avoidable 9410drains 9410detectably 9410husky 9410impelling 9410undoes 9410evened 9410squeezes 9410destroyer 9410rudeness 9410beaner 9410boorish 9410Everhart 9410encompass 9410mushrooms 9410Alison 9410externally 9410pellagra 9410cult 9410creek 9410Huffman 9410Majorca 9410governing 9410gadfly 9410reassigned 9410intentness 9410craziness 9410psychic 9410squabbled 9410burlesque 9410capped 9410extracted 9410DiMaggio 9410exclamation 9410subdirectory 9410Gothicism 9410feminine 9410metaphysically 9410sanding 9410Miltonism 9410freakish 9410index 9410straight 9410flurried 9410denotative 9410coming 9410commencements 9410gentleman 9410gifted 9410Shanghais 9410sportswriting 9410sloping 9410navies 9410leaflet 9410shooter 9410Joplin 9410babies 9410assails 9410admiring 9410swaying 9410Goldstine 9410fitting 9410Norwalk 9410analogy 9410deludes 9410cokes 9410Clayton 9410exhausts 9410causality 9410sating 9410icon 9410throttles 9410communicants 9410dehydrate 9410priceless 9410publicly 9410incidentals 9410commonplace 9410mumbles 9410furthermore 9410cautioned 9410parametrized 9410registration 9410sadly 9410positioning 9410babysitting 9410eternal 9410hoarder 9410congregates 9410rains 9410workers 9410sags 9410unplug 9410garage 9410boulder 9410specifics 9410Teresa 9410Winsett 9410convenient 9410buckboards 9410amenities 9410resplendent 9410sews 9410participated 9410Simon 9410certificates 9410Fitzpatrick 9410Evanston 9410misted 9410textures 9410save 9410count 9410rightful 9410chaperone 9410Lizzy 9410clenched 9410effortlessly 9410accessed 9410beaters 9410Hornblower 9410vests 9410indulgences 9410infallibly 9410unwilling 9410excrete 9410spools 9410crunches 9410overestimating 9410ineffective 9410humiliation 9410sophomore 9410star 9410rifles 9410dialysis 9410arriving 9410indulge 9410clockers 9410languages 9410Antarctica 9410percentage 9410ceiling 9410specification 9410regimented 9410ciphers 9410pictures 9410serpents 9410allot 9410realized 9410mayoral 9410opaquely 9410hostess 9410fiftieth 9410incorrectly 9410decomposition 9410stranglings 9410mixture 9410electroencephalography 9410similarities 9410charges 9410freest 9410Greenberg 9410tinting 9410expelled 9410warm 9410smoothed 9410deductions 9410Romano 9410bitterroot 9410corset 9410securing 9410environing 9410cute 9410Crays 9410heiress 9410inform 9410avenge 9410universals 9410Kinsey 9410ravines 9410bestseller 9410equilibrium 9410extents 9410relatively 9410pressure 9410critiques 9410befouled 9410rightfully 9410mechanizing 9410Latinizes 9410timesharing 9410Aden 9410embassies 9410males 9410shapelessly 9410mastering 9410Newtonian 9410finishers 9410abates 9410teem 9410kiting 9410stodgy 9410feed 9410guitars 9410airships 9410store 9410denounces 9410Pyle 9410Saxony 9410serializations 9410Peruvian 9410taxonomically 9410kingdom 9410stint 9410Sault 9410faithful 9410Ganymede 9410tidiness 9410gainful 9410contrary 9410Tipperary 9410tropics 9410theorizers 9410renew 9410already 9410terminal 9410Hegelian 9410hypothesizer 9410warningly 9410journalizing 9410nested 9410Lars 9410saplings 9410foothill 9410labeled 9410imperiously 9410reporters 9410furnishings 9410precipitable 9410discounts 9410excises 9410Stalin 9410despot 9410ripeness 9410Arabia 9410unruly 9410mournfulness 9410boom 9410slaughter 9410Sabine 9410handy 9410rural 9410organizer 9410shipyard 9410civics 9410inaccuracy 9410rules 9410juveniles 9410comprised 9410investigations 9410stabilizes 9410seminaries 9410Hunter 9410sporty 9410test 9410weasels 9410CERN 9410tempering 9410afore 9410Galatean 9410techniques 9410error 9410veranda 9410severely 9410Cassites 9410forthcoming 9410guides 9410vanish 9410lied 9410sawtooth 9410fated 9410gradually 9410widens 9410preclude 9410evenhandedly 9410percentage 9410disobedience 9410humility 9410gleaning 9410petted 9410bloater 9410minion 9410marginal 9410apiary 9410measures 9410precaution 9410repelled 9410primary 9410coverings 9410Artemia 9410navigate 9410spatial 9410Gurkha 9410meanwhile 9410Melinda 9410Butterfield 9410Aldrich 9410previewing 9410glut 9410unaffected 9410inmate 9410mineral 9410impending 9410meditation 9410ideas 9410miniaturizes 9410lewdly 9410title 9410youthfulness 9410creak 9410Chippewa 9410clamored 9410freezes 9410forgivably 9410reduce 9410McGovern 9410Nazis 9410epistle 9410socializes 9410conceptions 9410Kevin 9410uncovering 9410chews 9410appendixes 9410appendixes 9410appendixes 9410appendixes 9410appendixes 9410appendixes 9410raining 9410infest 9410compartment 9410minting 9410ducks 9410roped 9410waltz 9410Lillian 9410repressions 9410chillingly 9410noncritical 9410lithograph 9410spongers 9410parenthood 9410posed 9410instruments 9410filial 9410fixedly 9410relives 9410Pandora 9410watering 9410ungrateful 9410secures 9410poison 9410dusted 9410encompasses 9410presentation 9410Kantian 9410select 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;fld3 period price price2admonishing 1002 28357832 8723648analyzable 1002 28357832 8723648annihilates 1001 5987435 234724Antares 1002 28357832 8723648astound 1001 5987435 234724audiology 1001 5987435 234724Augustine 1002 28357832 8723648Baird 1002 28357832 8723648bewilderingly 1001 5987435 234724breaking 1001 5987435 234724Conley 1001 5987435 234724dentally 1002 28357832 8723648dissociate 1002 28357832 8723648elite 1001 5987435 234724eschew 1001 5987435 234724Eulerian 1001 5987435 234724flanking 1001 5987435 234724foldout 1002 28357832 8723648funereal 1002 28357832 8723648galling 1002 28357832 8723648Graves 1001 5987435 234724grazing 1001 5987435 234724groupings 1001 5987435 234724handgun 1001 5987435 234724humility 1002 28357832 8723648impulsive 1002 28357832 8723648inch 1001 5987435 234724intelligibility 1001 5987435 234724jarring 1001 5987435 234724lawgiver 1001 5987435 234724lectured 1002 28357832 8723648Merritt 1002 28357832 8723648neonatal 1001 5987435 234724offload 1002 28357832 8723648parters 1002 28357832 8723648pityingly 1002 28357832 8723648puddings 1002 28357832 8723648Punjab 1001 5987435 234724quitter 1002 28357832 8723648realtor 1001 5987435 234724relaxing 1001 5987435 234724repetitions 1001 5987435 234724resumes 1001 5987435 234724Romans 1002 28357832 8723648rusting 1001 5987435 234724scholastics 1001 5987435 234724skulking 1002 28357832 8723648stated 1002 28357832 8723648suites 1002 28357832 8723648sureties 1001 5987435 234724testicle 1002 28357832 8723648tinily 1002 28357832 8723648tragedies 1001 5987435 234724trimmings 1001 5987435 234724vacuuming 1001 5987435 234724ventilate 1001 5987435 234724wallet 1001 5987435 234724Weissmuller 1002 28357832 8723648Wotan 1002 28357832 8723648select 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;fld1 fld3 period price price2018201 relaxing 1001 5987435 234724018601 vacuuming 1001 5987435 234724018801 inch 1001 5987435 234724018811 repetitions 1001 5987435 234724create table t4 (companynr tinyint(2) unsigned zerofill NOT NULL default '00',companyname char(30) NOT NULL default '',PRIMARY KEY (companynr),UNIQUE KEY companyname(companyname)) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;companynr companyname00 Unknown29 company 134 company 236 company 337 company 440 company 541 company 650 company 1153 company 758 company 865 company 968 company 10select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;companynr companyname00 Unknown29 company 134 company 236 company 337 company 440 company 541 company 650 company 1153 company 758 company 865 company 968 company 10select * from t1,t1 t12;Period Varor_period Period Varor_period9410 9412 9410 9412select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505;fld1 fld1250501 250501250502 250501250503 250501250504 250501250505 250501250501 250502250502 250502250503 250502250504 250502250505 250502250501 250503250502 250503250503 250503250504 250503250505 250503250501 250504250502 250504250503 250504250504 250504250505 250504250501 250505250502 250505250503 250505250504 250505250505 250505insert into t2 (fld1, companynr) values (999999,99);select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;companynr companyname99 NULLselect count(*) from t2 left join t4 using (companynr) where t4.companynr is not null;count(*)1199explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not existsexplain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t4 ALL NULL NULL NULL NULL 12 1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 Using where; Not existsselect companynr,companyname from t2 left join t4 using (companynr) where companynr is null;companynr companynameselect count(*) from t2 left join t4 using (companynr) where companynr is not null;count(*)1200explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHEREexplain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHEREdelete from t2 where fld1=999999;explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t4 ALL NULL NULL NULL NULL 12 1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using whereexplain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using whereexplain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t4 ALL NULL NULL NULL NULL 12 1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using whereexplain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;companynr companynr37 3641 40explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using whereselect 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;fld1 companynr fld3 period038008 37 reporters 1008038208 37 Selfridge 1008select 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;fld1 companynr fld3 period038008 37 reporters 1008038208 37 Selfridge 1008select 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;fld1 companynr fld3 period038008 37 reporters 1008038208 37 Selfridge 1008select 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);period9410select 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)));period9410select 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;fld1250501250502250503250505select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606);fld1250502250503select fld1 from t2 where fld1 between 250502 and 250504;fld1250502250503250504select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ;fld3labellabeledlabeledlandslidelaterallyleafletlewdlyLillianluckilyselect count(*) from t1;count(*)1select companynr,count(*),sum(fld1) from t2 group by companynr;companynr count(*) sum(fld1)00 82 1035575329 95 1447329834 70 1778896636 215 2278629637 588 8360209840 37 661838641 52 1281633550 11 159543853 4 79321058 23 225429365 10 228405568 12 3097288select companynr,count(*) from t2 group by companynr order by companynr desc limit 5;companynr count(*)68 1265 1058 2353 450 11select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1)70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using whereWarnings: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` <> _latin1''))select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3;companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1)00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.708729 95 abut wetness 14473298 152350.5053 8368.5480 70032594.902634 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;companynr t2nr count(price) sum(price) min(price) max(price) avg(price)37 1 1 5987435 5987435 5987435 5987435.000037 2 1 28357832 28357832 28357832 28357832.000037 3 1 39654943 39654943 39654943 39654943.000037 11 1 5987435 5987435 5987435 5987435.000037 12 1 28357832 28357832 28357832 28357832.000037 13 1 39654943 39654943 39654943 39654943.000037 21 1 5987435 5987435 5987435 5987435.000037 22 1 28357832 28357832 28357832 28357832.000037 23 1 39654943 39654943 39654943 39654943.000037 31 1 5987435 5987435 5987435 5987435.0000select /*! 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;companynr t2nr count(price) sum(price) min(price) max(price) avg(price)37 1 1 5987435 5987435 5987435 5987435.000037 2 1 28357832 28357832 28357832 28357832.000037 3 1 39654943 39654943 39654943 39654943.000037 11 1 5987435 5987435 5987435 5987435.000037 12 1 28357832 28357832 28357832 28357832.000037 13 1 39654943 39654943 39654943 39654943.000037 21 1 5987435 5987435 5987435 5987435.000037 22 1 28357832 28357832 28357832 28357832.000037 23 1 39654943 39654943 39654943 39654943.000037 31 1 5987435 5987435 5987435 5987435.0000select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ;companynr count(price) sum(price) min(price) max(price) avg(price)37 12543 309394878010 5987435 39654943 24666736.666778 8362 414611089292 726498 98439034 49582766.0000101 4181 3489454238 834598 834598 834598.0000154 4181 4112197254950 983543950 983543950 983543950.0000311 4181 979599938 234298 234298 234298.0000447 4181 9929180954 2374834 2374834 2374834.0000512 4181 3288532102 786542 786542 786542.0000select distinct mod(companynr,10) from t4 group by companynr;mod(companynr,10)094671385select distinct 1 from t4 group by companynr;11select count(distinct fld1) from t2;count(distinct fld1)1199select companynr,count(distinct fld1) from t2 group by companynr;companynr count(distinct fld1)00 8229 9534 7036 21537 58840 3741 5250 1153 458 2365 1068 12select companynr,count(*) from t2 group by companynr;companynr count(*)00 8229 9534 7036 21537 58840 3741 5250 1153 458 2365 1068 12select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr;companynr count(distinct concat(fld1,repeat(65,1000)))00 8229 9534 7036 21537 58840 3741 5250 1153 458 2365 1068 12select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr;companynr count(distinct concat(fld1,repeat(65,200)))00 8229 9534 7036 21537 58840 3741 5250 1153 458 2365 1068 12select companynr,count(distinct floor(fld1/100)) from t2 group by companynr;companynr count(distinct floor(fld1/100))00 4729 3534 1436 6937 10840 1641 1150 953 158 165 168 1select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr;companynr count(distinct concat(repeat(65,1000),floor(fld1/100)))00 4729 3534 1436 6937 10840 1641 1150 953 158 165 168 1select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10;sum(fld1) fld311402 Romansselect name,count(*) from t3 where name='cloakroom' group by name;name count(*)cloakroom 4181select name,count(*) from t3 where name='cloakroom' and price>10 group by name;name count(*)cloakroom 4181select count(*) from t3 where name='cloakroom' and price2=823742;count(*)4181select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name;name count(*)cloakroom 4181select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name;name count(*)extramarital 4181gazer 4181gems 4181Iranizes 4181spates 4181tucked 4181violinist 4181select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;fld3 count(*)spates 4181select companynr|0,companyname from t4 group by 1;companynr|0 companyname0 Unknown29 company 134 company 236 company 337 company 440 company 541 company 650 company 1153 company 758 company 865 company 968 company 10select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname;companynr companyname count(*)29 company 1 9568 company 10 1250 company 11 1134 company 2 7036 company 3 21537 company 4 58840 company 5 3741 company 6 5253 company 7 458 company 8 2365 company 9 1000 Unknown 82select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;fld1 count(*)158402 4181select sum(Period)/count(*) from t1;sum(Period)/count(*)9410.0000select 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;companynr count sum diff func37 12543 309394878010 0.0000 46409178 8362 414611089292 0.0000 652236101 4181 3489454238 0.0000 422281154 4181 4112197254950 0.0000 643874311 4181 979599938 0.0000 1300291447 4181 9929180954 0.0000 1868907512 4181 3288532102 0.0000 2140672select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg;companynr avg154 983543950.0000select companynr,count(*) from t2 group by companynr order by 2 desc;companynr count(*)37 58836 21529 9500 8234 7041 5240 3758 2368 1250 1165 1053 4select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc;companynr count(*)41 5258 2368 1250 1165 1053 4select 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;fld4 fld1 count(price) sum(price) min(price) max(price) avg(price)teethe 000001 1 5987435 5987435 5987435 5987435.0000dreaded 011401 1 5987435 5987435 5987435 5987435.0000scholastics 011402 1 28357832 28357832 28357832 28357832.0000audiology 011403 1 39654943 39654943 39654943 39654943.0000wallet 011501 1 5987435 5987435 5987435 5987435.0000parters 011701 1 5987435 5987435 5987435 5987435.0000eschew 011702 1 28357832 28357832 28357832 28357832.0000quitter 011703 1 39654943 39654943 39654943 39654943.0000neat 012001 1 5987435 5987435 5987435 5987435.0000Steinberg 012003 1 39654943 39654943 39654943 39654943.0000balled 012301 1 5987435 5987435 5987435 5987435.0000persist 012302 1 28357832 28357832 28357832 28357832.0000attainments 012303 1 39654943 39654943 39654943 39654943.0000capably 012501 1 5987435 5987435 5987435 5987435.0000impulsive 012602 1 28357832 28357832 28357832 28357832.0000starlet 012603 1 39654943 39654943 39654943 39654943.0000featherweight 012701 1 5987435 5987435 5987435 5987435.0000pessimist 012702 1 28357832 28357832 28357832 28357832.0000daughter 012703 1 39654943 39654943 39654943 39654943.0000lawgiver 013601 1 5987435 5987435 5987435 5987435.0000stated 013602 1 28357832 28357832 28357832 28357832.0000readable 013603 1 39654943 39654943 39654943 39654943.0000testicle 013801 1 5987435 5987435 5987435 5987435.0000Parsifal 013802 1 28357832 28357832 28357832 28357832.0000leavings 013803 1 39654943 39654943 39654943 39654943.0000squeaking 013901 1 5987435 5987435 5987435 5987435.0000contrasted 016001 1 5987435 5987435 5987435 5987435.0000leftover 016201 1 5987435 5987435 5987435 5987435.0000whiteners 016202 1 28357832 28357832 28357832 28357832.0000erases 016301 1 5987435 5987435 5987435 5987435.0000Punjab 016302 1 28357832 28357832 28357832 28357832.0000Merritt 016303 1 39654943 39654943 39654943 39654943.0000sweetish 018001 1 5987435 5987435 5987435 5987435.0000dogging 018002 1 28357832 28357832 28357832 28357832.0000scornfully 018003 1 39654943 39654943 39654943 39654943.0000fetters 018012 1 28357832 28357832 28357832 28357832.0000bivalves 018013 1 39654943 39654943 39654943 39654943.0000skulking 018021 1 5987435 5987435 5987435 5987435.0000flint 018022 1 28357832 28357832 28357832 28357832.0000flopping 018023 1 39654943 39654943 39654943 39654943.0000Judas 018032 1 28357832 28357832 28357832 28357832.0000vacuuming 018033 1 39654943 39654943 39654943 39654943.0000medical 018041 1 5987435 5987435 5987435 5987435.0000bloodbath 018042 1 28357832 28357832 28357832 28357832.0000subschema 018043 1 39654943 39654943 39654943 39654943.0000interdependent 018051 1 5987435 5987435 5987435 5987435.0000Graves 018052 1 28357832 28357832 28357832 28357832.0000neonatal 018053 1 39654943 39654943 39654943 39654943.0000sorters 018061 1 5987435 5987435 5987435 5987435.0000epistle 018062 1 28357832 28357832 28357832 28357832.0000Conley 018101 1 5987435 5987435 5987435 5987435.0000lectured 018102 1 28357832 28357832 28357832 28357832.0000Abraham 018103 1 39654943 39654943 39654943 39654943.0000cage 018201 1 5987435 5987435 5987435 5987435.0000hushes 018202 1 28357832 28357832 28357832 28357832.0000Simla 018402 1 28357832 28357832 28357832 28357832.0000reporters 018403 1 39654943 39654943 39654943 39654943.0000coexist 018601 1 5987435 5987435 5987435 5987435.0000Beebe 018602 1 28357832 28357832 28357832 28357832.0000Taoism 018603 1 39654943 39654943 39654943 39654943.0000Connally 018801 1 5987435 5987435 5987435 5987435.0000fetched 018802 1 28357832 28357832 28357832 28357832.0000checkpoints 018803 1 39654943 39654943 39654943 39654943.0000gritty 018811 1 5987435 5987435 5987435 5987435.0000firearm 018812 1 28357832 28357832 28357832 28357832.0000minima 019101 1 5987435 5987435 5987435 5987435.0000Selfridge 019102 1 28357832 28357832 28357832 28357832.0000disable 019103 1 39654943 39654943 39654943 39654943.0000witchcraft 019201 1 5987435 5987435 5987435 5987435.0000betroth 030501 1 5987435 5987435 5987435 5987435.0000Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000imprint 030503 1 39654943 39654943 39654943 39654943.0000swelling 031901 1 5987435 5987435 5987435 5987435.0000interrelationships 036001 1 5987435 5987435 5987435 5987435.0000riser 036002 1 28357832 28357832 28357832 28357832.0000bee 038001 1 5987435 5987435 5987435 5987435.0000kanji 038002 1 28357832 28357832 28357832 28357832.0000dental 038003 1 39654943 39654943 39654943 39654943.0000railway 038011 1 5987435 5987435 5987435 5987435.0000validate 038012 1 28357832 28357832 28357832 28357832.0000normalizes 038013 1 39654943 39654943 39654943 39654943.0000Kline 038101 1 5987435 5987435 5987435 5987435.0000Anatole 038102 1 28357832 28357832 28357832 28357832.0000partridges 038103 1 39654943 39654943 39654943 39654943.0000recruited 038201 1 5987435 5987435 5987435 5987435.0000dimensions 038202 1 28357832 28357832 28357832 28357832.0000Chicana 038203 1 39654943 39654943 39654943 39654943.0000select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3;companynr fld3 sum(price)512 boat 786542512 capably 786542512 cupboard 786542512 decliner 786542512 descendants 786542512 dopers 786542512 erases 786542512 Micronesia 786542512 Miles 786542512 skies 786542select 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;companynr count(*) min(fld3) max(fld3) sum(price) avg(price)00 1 Omaha Omaha 5987435 5987435.000036 1 dubbed dubbed 28357832 28357832.000037 83 Abraham Wotan 1908978016 22999735.132550 2 scribbled tapestry 68012775 34006387.5000select 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;t3.companynr+0 t2nr fld3 sum(price)37 1 Omaha 598743537 11401 breaking 598743537 11402 Romans 2835783237 11403 intercepted 3965494337 11501 bewilderingly 598743537 11701 astound 598743537 11702 admonishing 2835783237 11703 sumac 3965494337 12001 flanking 598743537 12003 combed 3965494337 12301 Eulerian 598743537 12302 dubbed 2835783237 12303 Kane 3965494337 12501 annihilates 598743537 12602 Wotan 2835783237 12603 snatching 3965494337 12701 grazing 598743537 12702 Baird 2835783237 12703 celery 3965494337 13601 handgun 598743537 13602 foldout 2835783237 13603 mystic 3965494337 13801 intelligibility 598743537 13802 Augustine 2835783237 13803 teethe 3965494337 13901 scholastics 598743537 16001 audiology 598743537 16201 wallet 598743537 16202 parters 2835783237 16301 eschew 598743537 16302 quitter 2835783237 16303 neat 3965494337 18001 jarring 598743537 18002 tinily 2835783237 18003 balled 3965494337 18012 impulsive 2835783237 18013 starlet 3965494337 18021 lawgiver 598743537 18022 stated 2835783237 18023 readable 3965494337 18032 testicle 2835783237 18033 Parsifal 3965494337 18041 Punjab 598743537 18042 Merritt 2835783237 18043 Quixotism 3965494337 18051 sureties 598743537 18052 puddings 2835783237 18053 tapestry 3965494337 18061 trimmings 598743537 18062 humility 2835783237 18101 tragedies 598743537 18102 skulking 2835783237 18103 flint 3965494337 18201 relaxing 598743537 18202 offload 2835783237 18402 suites 2835783237 18403 lists 3965494337 18601 vacuuming 598743537 18602 dentally 2835783237 18603 humanness 3965494337 18801 inch 598743537 18802 Weissmuller 2835783237 18803 irresponsibly 3965494337 18811 repetitions 598743537 18812 Antares 2835783237 19101 ventilate 598743537 19102 pityingly 2835783237 19103 interdependent 3965494337 19201 Graves 598743537 30501 neonatal 598743537 30502 scribbled 2835783237 30503 chafe 3965494337 31901 realtor 598743537 36001 elite 598743537 36002 funereal 2835783237 38001 Conley 598743537 38002 lectured 2835783237 38003 Abraham 3965494337 38011 groupings 598743537 38012 dissociate 2835783237 38013 coexist 3965494337 38101 rusting 598743537 38102 galling 2835783237 38103 obliterates 3965494337 38201 resumes 598743537 38202 analyzable 2835783237 38203 terminator 39654943select 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;sum(price)234298select 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;fld1 sum(price)038008 234298explain select fld3 from t2 where 1>2 or 2>3;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHEREexplain select fld3 from t2 where fld1=fld1;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502;companynr fld134 25050134 250502select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502;companynr fld134 25050134 250502select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000;companynr count sum00 82 1035575329 95 1447329834 70 1778896637 588 8360209841 52 12816335select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ;companynr0029343741select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40;companynr companyname count(*)68 company 10 1250 company 11 1140 company 5 3741 company 6 5253 company 7 458 company 8 2365 company 9 10select count(*) from t2;count(*)1199select count(*) from t2 where fld1 < 098024;count(*)387select min(fld1) from t2 where fld1>= 098024;min(fld1)98024select max(fld1) from t2 where fld1>= 098024;max(fld1)1232609select count(*) from t3 where price2=76234234;count(*)4181select count(*) from t3 where companynr=512 and price2=76234234;count(*)4181explain select min(fld1),max(fld1),count(*) from t2;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect min(fld1),max(fld1),count(*) from t2;min(fld1) max(fld1) count(*)0 1232609 1199select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742;min(t2nr) max(t2nr)2115 2115select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78;count(*) min(t2nr) max(t2nr)4181 4 41804select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20;t2nr count(*)9 119 129 139 149 159 169 179 189 199 1109 1119 1129 1139 1149 1159 1169 1179 1189 1199 1select max(t2nr) from t3 where price=983543950;max(t2nr)41807select t1.period from t3 = t1 limit 1;period1001select t1.period from t1 as t1 limit 1;period9410select t1.period as "Nuvarande period" from t1 as t1 limit 1;Nuvarande period9410select period as ok_period from t1 limit 1;ok_period9410select period as ok_period from t1 group by ok_period limit 1;ok_period9410select 1+1 as summa from t1 group by summa limit 1;summa2select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1;Nuvarande period9410show tables;Tables_in_testt1t2t3t4show tables from test like "s%";Tables_in_test (s%)show tables from test like "t?";Tables_in_test (t?)show full columns from t2;Field Type Collation Null Key Default Extra Privileges Commentauto int(11) NULL NO PRI NULL auto_increment # fld1 int(6) unsigned zerofill NULL NO UNI 000000 # companynr tinyint(2) unsigned zerofill NULL NO 00 # fld3 char(30) latin1_swedish_ci NO MUL # fld4 char(35) latin1_swedish_ci NO # fld5 char(35) latin1_swedish_ci NO # fld6 char(4) latin1_swedish_ci NO # show full columns from t2 from test like 'f%';Field Type Collation Null Key Default Extra Privileges Commentfld1 int(6) unsigned zerofill NULL NO UNI 000000 # fld3 char(30) latin1_swedish_ci NO MUL # fld4 char(35) latin1_swedish_ci NO # fld5 char(35) latin1_swedish_ci NO # fld6 char(4) latin1_swedish_ci NO # show full columns from t2 from test like 's%';Field Type Collation Null Key Default Extra Privileges Commentshow keys from t2;Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Commentt2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE t2 1 fld3 1 fld3 A NULL NULL NULL BTREE drop table t4, t3, t2, t1;CREATE TABLE t1 (cont_nr int(11) NOT NULL auto_increment,ver_nr int(11) NOT NULL default '0',aufnr int(11) NOT NULL default '0',username varchar(50) NOT NULL default '',hdl_nr int(11) NOT NULL default '0',eintrag date NOT NULL default '0000-00-00',st_klasse varchar(40) NOT NULL default '',st_wert varchar(40) NOT NULL default '',st_zusatz varchar(40) NOT NULL default '',st_bemerkung varchar(255) NOT NULL default '',kunden_art varchar(40) NOT NULL default '',mcbs_knr int(11) default NULL,mcbs_aufnr int(11) NOT NULL default '0',schufa_status char(1) default '?',bemerkung text,wirknetz text,wf_igz int(11) NOT NULL default '0',tarifcode varchar(80) default NULL,recycle char(1) default NULL,sim varchar(30) default NULL,mcbs_tpl varchar(30) default NULL,emp_nr int(11) NOT NULL default '0',laufzeit int(11) default NULL,hdl_name varchar(30) default NULL,prov_hdl_nr int(11) NOT NULL default '0',auto_wirknetz varchar(50) default NULL,auto_billing varchar(50) default NULL,touch timestamp NOT NULL,kategorie varchar(50) default NULL,kundentyp varchar(20) NOT NULL default '',sammel_rech_msisdn varchar(30) NOT NULL default '',p_nr varchar(9) NOT NULL default '',suffix char(3) NOT NULL default '',PRIMARY KEY (cont_nr),KEY idx_aufnr(aufnr),KEY idx_hdl_nr(hdl_nr),KEY idx_st_klasse(st_klasse),KEY ver_nr(ver_nr),KEY eintrag_idx(eintrag),KEY emp_nr_idx(emp_nr),KEY wf_igz(wf_igz),KEY touch(touch),KEY hdl_tag(eintrag,hdl_nr),KEY prov_hdl_nr(prov_hdl_nr),KEY mcbs_aufnr(mcbs_aufnr),KEY kundentyp(kundentyp),KEY p_nr(p_nr,suffix)) ENGINE=MyISAM;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','','','');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','','','');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','','','');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','','','');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');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','','','');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','','','');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;Kundentyp kategoriePrivat (Private Nutzung) MobilfunkWarnings:Warning 1052 Column 'kundentyp' in group statement is ambiguousdrop table t1;SHOW STATUS LIKE 'Ssl_cipher';Variable_name ValueSsl_cipher DHE-RSA-AES256-SHASHOW STATUS LIKE 'Compression';Variable_name ValueCompression ON
|