MySQL Min()函数
MySQL Min()函数
MySQL的Min()函数用来找出记录集的最小值纪录。
理解Min()函数,考虑一个employee_tbl表,它是具有以下记录:
mysql> SELECT * FROM employee_tbl; +------+------+------------+--------------------+ | id | name | work_date | daily_typing_pages | +------+------+------------+--------------------+ | 1 | John | 2007-01-24 | 250 | | 2 | Ram | 2007-05-27 | 220 | | 3 | Jack | 2007-05-06 | 170 | | 3 | Jack | 2007-04-06 | 100 | | 4 | Jill | 2007-04-06 | 220 | | 5 | Zara | 2007-06-06 | 300 | | 5 | Zara | 2007-02-06 | 350 | +------+------+------------+--------------------+ 7 rows in set (0.00 sec)
现在假设根据上表中,想获取daily_typing_pages的最小值,那么可以简单地使用下面的命令:
mysql> SELECT MIN(daily_typing_pages) -> FROM employee_tbl; +-------------------------+ | MIN(daily_typing_pages) | +-------------------------+ | 100 | +-------------------------+ 1 row in set (0.00 sec)
使用GROUP BY子句找到所有每个名称最小值的记录如下:
mysql>SELECT id, name, MIN(daily_typing_pages) -> FROM employee_tbl GROUP BY name; +------+------+-------------------------+ | id | name | MIN(daily_typing_pages) | +------+------+-------------------------+ | 3 | Jack | 100 | | 4 | Jill | 220 | | 1 | John | 250 | | 2 | Ram | 220 | | 5 | Zara | 300 | +------+------+-------------------------+ 5 rows in set (0.00 sec)
可以使用Min()函数和Max()函数一起,找出最小值和最大值。试试下面的例子:
mysql> SELECT MIN(daily_typing_pages) least, MAX(daily_typing_pages) max -> FROM employee_tbl; +-------+------+ | least | max | +-------+------+ | 100 | 350 | +-------+------+ 1 row in set (0.01 sec)
buy augmentin 375mg order augmentin 625mg pills clomid 50mg oral
buy generic lexapro buy escitalopram 20mg online cheap buy naltrexone medication
lasix where to buy buy ventolin sale order ventolin 2mg pills
buy strattera 25mg generic order generic sertraline 100mg order sertraline
actigall 300mg sale buy generic bupropion buy cetirizine 5mg for sale
sucralfetprin stomach coating medication best medicine for acid reflux stinky fart pills
deltasone 40mg generic amoxicillin canada order generic amoxicillin
walgreens birth control pills price how to last longer men exercises to cure premature ejaculation
purchase phenergan sale buy phenergan pills stromectol 3mg cost
what causes duodenal erosion hypertensive crisis treatment drugs uti treatment online prescription
duloxetine 20mg over the counter duloxetine brand provigil generic
fungal nail tablets blood pressure medication with least side effects beverages that lower blood pressure
buy generic cyproheptadine for sale periactin where to buy buy nizoral without prescription
nhs stop smoking clinic online doctor consultation pain prescription buy prescription pain pills online
medroxyprogesterone 5mg us medroxyprogesterone over the counter buy microzide 25mg online
virtual visit online physician belsomra topical dutasteride for hair loss online weight loss doctor prescription
purchase femara order albenza online cheap abilify 30mg us
generic alfuzosin 10mg meds for vomiting anti nausea medication brand names
buy minocin pill minocin usa buy ropinirole pills
buy acne pills online best doctor prescribed acne medication trileptal 300mg brand
clonidine 0.1 mg usa spiriva 9 mcg ca oral tiotropium bromide 9mcg
rocaltrol 0.25mg for sale rocaltrol 0.25mg brand order generic tricor 200mg
how to buy trimox buy arimidex no prescription order biaxin 500mg generic
practice essay writing online best online casino free poker games
professional letter writing services science article reviews cefixime for sale online
buy aspirin sale win real money online instantly no deposit free slots casino games
buy generic lamisil for sale casino real money free play real money blackjack
how to buy trazodone buy clindac a cheap buy clindamycin cheap
order cefuroxime for sale buy robaxin pills for sale buy methocarbamol 500mg pill
buy tadalafil for sale purchase tadacip pills buy indocin 75mg generic
buy nolvadex paypal order symbicort generic budesonide cost
retin cream for sale buy retin generic buy avanafil 100mg online
cleocin 300mg pill erectile dysfunction pills over the counter purchase fildena without prescription
order lamictal 50mg generic minipress 2mg sale buy mebendazole paypal
metronidazole 200mg tablet metronidazole 200mg over the counter keflex 125mg over the counter
diflucan canada fluconazole buy online buy ciprofloxacin medication
order aurogra 50mg online oral sildalis buy estradiol no prescription
aldactone ca brand spironolactone 100mg order finasteride sale
pay for assignment how to write an essay about my family websites to write essays
order flomax 0.2mg sale cheap zocor 10mg buy simvastatin 20mg online
buy domperidone 10mg online sumycin medication order sumycin 250mg without prescription
zantac price mobic pills buy celebrex online
buspirone 5mg over the counter oral cordarone cordarone for sale online
imitrex 25mg pills imitrex 25mg usa dutasteride for sale online
order zyloprim 300mg online cheap buy generic zyloprim online buy crestor 20mg generic
buy esomeprazole cheap buy nexium generic buy generic topamax
famotidine 20mg tablet famotidine 40mg usa prograf 5mg price
astelin 10 ml ca avalide order irbesartan canada
buy warfarin maxolon medication reglan tablet
buy cheap orlistat buy mesalamine order diltiazem 180mg online cheap
order nortriptyline online order pamelor 25 mg online cheap buy anacin pills for sale
buy propranolol online clopidogrel medication clopidogrel cost
alendronate pill nitrofurantoin 100 mg tablet nitrofurantoin us
order amaryl 4mg order generic misoprostol 200mcg buy etoricoxib 60mg online
buy lioresal sale ketorolac without prescription buy toradol 10mg pill
baclofen pills buy baclofen pills buy cheap ketorolac
purchase loratadine pills buy priligy online order dapoxetine 90mg online
buy phenytoin 100mg online cheap order ditropan 5mg order ditropan 5mg generic
vardenafil 10mg usa order levitra 20mg pill tizanidine 2mg us
buy clomiphene generic order imdur sale purchase imuran generic
medrol over counter buy adalat 10mg generic triamcinolone 4mg usa
free poker games augmentin 1000mg without prescription levothyroxine online buy
live blackjack casino slot free ivermectin 90 mg
amantadine 100mg pills symmetrel price dapsone where to buy
online money poker monodox medication albuterol pill
cost pantoprazole buy zestril 5mg without prescription buy pyridium 200mg online cheap
casino online games global poker online buy furosemide pills for sale
azithromycin 500mg over the counter buy gabapentin medication buy neurontin tablets
buy generic lipitor 10mg buy albuterol for sale brand norvasc
isotretinoin for sale online zithromax pills how to get zithromax without a prescription
order modafinil pill buy promethazine 25mg generic order deltasone 20mg without prescription
omnicef price generic glycomet buy prevacid without a prescription
order cenforce 50mg without prescription order cenforce 50mg online cheap brand chloroquine
cialis online canada overnight cialis delivery viagra 50mg brand
buy premarin 600 mg without prescription buy viagra 50mg pill sildenafil order
buy omeprazole for sale metoprolol 50mg drug purchase lopressor without prescription
order betahistine 16mg online cost betahistine probenecid 500 mg sale
where can i buy latanoprost purchase zovirax for sale order rivastigmine 3mg sale
order vasotec buy generic lactulose over the counter duphalac canada
order mestinon 60mg sale feldene 20 mg sale how to get maxalt without a prescription
buy ferrous sulfate pills order actonel 35 mg online cheap buy sotalol 40mg generic
prasugrel 10 mg drug buy tolterodine 2mg for sale order detrol 2mg online
etodolac 600 mg price colospa over the counter order generic pletal
florinef tablet fludrocortisone 100mcg generic buy cheap imodium
dydrogesterone 10mg cost dydrogesterone for sale online empagliflozin pills
purchase melatonin generic danazol 100 mg uk danazol 100 mg drug
oral dipyridamole 100mg pravachol drug generic pravachol
aspirin 75mg pills aspirin canada imiquimod sale
buy precose for sale fulvicin online order fulvicin brand
minoxytop for sale online best erection pills ed pills comparison
overnight cialis delivery buy sildenafil without prescription sildenafil mail order us
zaditor 1 mg us geodon 80mg for sale purchase imipramine
fenofibrate 200mg cost cheap fenofibrate order tricor sale