MySQL Count()函数

MySQL Count()函数

MySQL Count()函数是用于统计记录数的数量的最简单的函数, 这是由 SELECT 语句返回。

理解 Count()  函数,考虑一个 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)

现在假定在上表的基础上计算这个表中的行总数,那么如下所示:

mysql>SELECT COUNT(*) FROM employee_tbl ;
+----------+
| COUNT(*) |
+----------+
|        7 |
+----------+
1 row in set (0.01 sec)

同样,如果要计算 Zara 记录数,那么如下:

mysql>SELECT COUNT(*) FROM employee_tbl
    -> WHERE name="Zara";
+----------+
| COUNT(*) |
+----------+
|        2 |
+----------+
1 row in set (0.04 sec)

注:所有的SQL查询是不区分大小写,所以它没有任何区别,如果在WHERE条件给定ZARA 或 Zara。

97 Responses

  1. Mbejqg说道:

    cheap escitalopram buy revia 50 mg online revia medication

  2. Pzxgeh说道:

    order lasix 40mg online monodox oral buy albuterol 2mg inhaler

  3. Rtetgd说道:

    order strattera 25mg without prescription sertraline oral buy zoloft 50mg pill

  4. Zjoxds说道:

    order actigall 300mg generic zyban generic order cetirizine generic

  5. Tmfmuh说道:

    zithromax us cheap zithromax order neurontin 600mg

  6. Yshert说道:

    best instant heartburn medicine medication that reduces stomach acid excessive flatuence and meidcations

  7. Xcwxdc说道:

    order prednisone 20mg without prescription prednisone 20mg for sale buy cheap generic amoxicillin

  8. Ipoibu说道:

    affordable birth control near me problems associated with micturition cummore pills price

  9. Apquob说道:

    buy generic phenergan online promethazine online stromectol generic name

  10. Xkadxr说道:

    antibiotics for gastritis in adults hypertensive crisis definition antibiotics for gram positive uti

  11. Vtmrky说道:

    duloxetine 20mg usa purchase glipizide sale buy modafinil pills

  12. Lrtztm说道:

    most common antifungal drugs buy lamisil tablets online high blood pressure medicines list

  13. Cwkuts说道:

    antiviral medication for hsv 2 asthma medication cost chart diabetic pills for humans

  14. Ikpiwo说道:

    periactin 4mg cheap cost nizoral buy generic nizoral for sale

  15. Rdxjiy说道:

    fda approval smoking cessation medication nicotine replacement calculator pain drugs listed for strengthen

  16. Ldxjvc说道:

    order medroxyprogesterone 10mg pill brand microzide microzide online buy

  17. Njyynn说道:

    sleeping pills prescribed online where to buy zopiclone pills online doctors for weight loss

  18. Ydbwbn说道:

    letrozole ca buy generic letrozole for sale abilify 30mg us

  19. Eotmbi说道:

    alfuzosin online buy nsaid with least stomach problems top 10 medicine stomach pain

  20. Ucoqot说道:

    buy minocin 100mg minocin over the counter order requip 1mg pill

  21. Vlwhij说道:

    acne medication by prescription dermatologist prescribed acne cream oxcarbazepine 300mg ca

  22. Ygvhgn说道:

    purchase catapres sale order antivert 25mg without prescription order generic tiotropium bromide 9mcg

  23. Xslpws说道:

    buy rocaltrol 0.25 mg without prescription trandate 100mg price tricor brand

  24. Rwexcc说道:

    buy trimox 500mg online buy clarithromycin online order biaxin for sale

  25. Kfkrdo说道:

    help writing paper win real money online casino casino gambling

  26. Dpsvjr说道:

    thesis writing services website that does math homework for you cefixime 100mg drug

  27. Pusfry说道:

    order aspirin 75 mg sale buy aspirin paypal slots games

  28. Gptunc说道:

    terbinafine online order lamisil online world poker online

  29. Fbhdkp说道:

    buy trazodone generic purchase clindac a online generic clindac a

  30. Xiagnz说道:

    cefuroxime 500mg cheap robaxin 500mg cost buy methocarbamol pills

  31. Dqazqs说道:

    tadalafil 10mg pill indomethacin 75mg oral buy indocin 75mg for sale

  32. Qlolqz说道:

    order nolvadex 20mg online order nolvadex 20mg pills buy generic rhinocort inhalers online

  33. Wuycnu说道:

    tretinoin us order avana 100mg pill buy avana generic

  34. Kexuby说道:

    clindamycin pill order cleocin without prescription buy ed pill

  35. Snxqtu说道:

    buy lamotrigine medication order mebendazole 100mg pills mebendazole online order

  36. Vsxihq说道:

    buy metronidazole 200mg pill purchase septra generic cost cephalexin 250mg

  37. Gzohxs说道:

    order fluconazole order generic ciprofloxacin cipro without prescription

  38. Ixnffe说道:

    sildenafil 50mg uk buy sildenafil 50mg sale estradiol online order

  39. Gpkctj说道:

    buy spironolactone 100mg spironolactone usa proscar us

  40. Dnjmti说道:

    dissertation writers online research papers writing academic writers online

  41. Twiyoc说道:

    purchase tamsulosin sale buy zofran 4mg pill generic simvastatin

  42. Uzrkrr说道:

    buy generic motilium over the counter purchase domperidone for sale sumycin us

  43. Vyribj说道:

    buy cheap ranitidine order ranitidine pill cheap celebrex 100mg

  44. Upfnyl说道:

    generic buspirone 10mg buspirone pills buy amiodarone pills

  45. Jkdadq说道:

    buy sumatriptan online cheap sumatriptan 50mg drug dutasteride canada

  46. Tpprlw说道:

    order allopurinol 300mg online cheap order temovate cream purchase crestor generic

  47. Iligcf说道:

    order nexium 20mg pills buy topiramate 100mg sale topamax for sale online

  48. Gxcgma说道:

    buy astelin without prescription irbesartan 300mg pills irbesartan 150mg ca

  49. Eghjjk说道:

    buy generic famotidine 40mg pepcid 20mg brand prograf 5mg price

  50. Vncqxz说道:

    buy cheap generic coumadin coumadin online buy maxolon online

  51. Sszqng说道:

    order xenical pills xenical 120mg for sale diltiazem ca

  52. Hebukg说道:

    buy nortriptyline 25mg without prescription acetaminophen 500mg brand buy panadol no prescription

  53. Gfgbdt说道:

    generic inderal 10mg nurofen over the counter plavix uk

  54. Znrbrb说道:

    glimepiride 1mg uk order amaryl 4mg etoricoxib usa

  55. Ipaouv说道:

    alendronate 70mg cost fosamax 70mg over the counter buy macrodantin online cheap

  56. thefe说道:

    Before you can withdraw redeem your prizes at Stake.us via crypto, you’ll need to have reached the minimum amount for redemption, which, when we checked, was 42.56 in Stake Cash if you wanted to cash out in Bitcoin. Crypto staking is only an option with currencies that offer a proof-of stake-model; not all currencies do. Here are some popular currencies that allow staking:  Get a crypto-backed loan. If one wishes to opt out of the system, the staked tokens undergo an unbonding period during which they are liable to being slashed for any misbehaviour committed by the validator before the unbonding period started. Delegated tokens enter unbonding period immediately upon unbond request. However, validators will need to serve a certain notice period in active state, participating in consensus and proposing checkpoints before entering into unbonding period. Stakers can withdraw their tokens after the unbonding period ends. Exact durations of withdraw for both delegator and validator will be announced here soon.
    http://xn--2y1by25awlasel42e.com/bbs/board.php?bo_table=free&wr_id=11992
    The 2014 documentary The Rise and Rise of Bitcoin portrays the diversity of motives behind the use of bitcoin by interviewing people who use it. These include a computer programmer and a drug dealer. The 2016 documentary Banking on Bitcoin is an introduction to the beginnings of bitcoin and the ideas behind cryptocurrency today. Out of the 21 million supply circulation of Bitcoin, 19 million has already been mined on April 1. Now, only 2 million Bitcoin have been left to be mined. The milestone comes almost 12 years after the first block, which consisted of 50 Bitcoins, was mined on January 9, 2009. Additionally, there is one more thing to keep in mind. Miners have been increasing the hash rates of their hardware in the last few years, which means that the block intervals are often set at 9.5 minutes instead of 10. This expedited mining time often leads to more than 1800 Bitcoin being created on a daily basis.

  57. Hgezrl说道:

    lioresal oral order ozobax online toradol drug

  58. Aneyrk说道:

    loratadine 10mg cheap purchase loratadine online cheap priligy medication

  59. Pzheqg说道:

    buy ozobax tablets elavil for sale buy toradol online cheap

  60. Cznags说道:

    buy dilantin online how to buy cyclobenzaprine buy oxybutynin cheap

  61. Jrguer说道:

    how to get aceon without a prescription order allegra generic buy allegra 120mg for sale

  62. Cptzeh说道:

    levitra medication tizanidine tablet buy zanaflex online cheap

  63. Braebe说道:

    how to get clomid without a prescription order isosorbide 40mg online buy imuran 25mg sale

  64. Nmsycu说道:

    medrol 16mg over counter buy medrol 16 mg online aristocort oral

  65. Xhojvx说道:

    online blackjack for real money synthroid 100mcg ca purchase levothroid pills

  66. Jwkwhv说道:

    amantadine 100 mg drug buy symmetrel 100 mg online dapsone 100mg sale

  67. Wnzfve说道:

    best casinos stromectol online stromectol cvs

  68. Bjlzqu说道:

    online blackjack with friends roulette online real money buy ventolin no prescription

  69. Cfayav说道:

    order pantoprazole 20mg online cheap cost protonix 40mg phenazopyridine ca

  70. Cfdgja说道:

    online blackjack live dealer lasix 40mg us lasix over the counter

  71. Btwtxn说道:

    azipro buy online prednisolone 10mg over the counter buy neurontin medication

  72. Lqjjgh说道:

    order lipitor 10mg without prescription buy proventil without a prescription norvasc us

  73. Utenen说道:

    isotretinoin 10mg price buy absorica online cheap azithromycin drug

  74. Locyyb说道:

    cefdinir 300 mg canada cefdinir 300mg usa lansoprazole over the counter

  75. Eqgsyp说道:

    buy generic provigil 100mg deltasone 40mg oral where to buy prednisone without a prescription

  76. Jvaids说道:

    order cenforce 50mg generic naproxen 500mg canada aralen 250mg over the counter

  77. Wywvcl说道:

    cialis 10mg us buy generic cialis 20mg viagra online

  78. Vvfyup说道:

    buy generic micardis online oral micardis 80mg order molnunat 200mg sale

  79. Qmkvsu说道:

    prilosec 10mg usa how to get singulair without a prescription lopressor price

  80. Mvbssq说道:

    order premarin online buy premarin 0.625mg pills order viagra

  81. Bvdnqm说道:

    order xalatan generic buy latanoprost generic order rivastigmine 6mg sale

  82. Ldllux说道:

    order betahistine for sale buy haloperidol sale benemid 500mg cost

  83. Pklxgr说道:

    generic vasotec 10mg purchase duphalac online cheap duphalac for sale online

  84. Wdnvjq说道:

    cost mestinon piroxicam 20 mg price purchase maxalt

  85. Dkmqix说道:

    order ferrous sulfate 100mg generic cost ascorbic acid order sotalol 40 mg online cheap

  86. Bodqmh说道:

    buy monograph without a prescription colospa online buy pletal order online

  87. Lsozdu说道:

    generic prasugrel 10mg chlorpromazine over the counter order detrol 2mg online cheap

  88. Sqnnor说道:

    fludrocortisone 100mcg us aciphex 10mg sale buy imodium 2mg online cheap

  89. Vzoqyo说道:

    buy dydrogesterone 10mg sale dapagliflozin for sale online buy generic jardiance 10mg

  90. Plcdiy说道:

    meloset 3mg uk buy melatonin no prescription brand danocrine 100 mg

  91. Arozoq说道:

    order dipyridamole online order plendil 5mg online cheap buy cheap generic pravachol

  92. Kklscf说道:

    buy aspirin 75 mg generic levoflox 500mg drug brand zovirax

  93. Rhfuem说道:

    purchase precose sale prandin 2mg generic buy fulvicin no prescription

  94. Wbaird说道:

    mintop uk free samples of ed pills buy ed pills paypal

  95. Qulikm说道:

    cialis 40mg generic order sildenafil 50mg online viagra sale

  96. Mhagdq说道:

    generic ketotifen 1 mg buy imipramine 25mg sale buy tofranil generic

  97. Mxgban说道:

    buy fenofibrate 160mg buy generic tricor over the counter order generic fenofibrate 200mg

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

CAPTCHAis initialing...