• <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>

    sql求某列的和、平均值、最大值、最小值、行數

    有時辰我們在寫sql語句的時辰,想求表中某列的和、平均值、最年夜值、最小值、行數,怎么寫sql語句呢,下面來分享一下方式

    東西/原料

    • sql語句
    • 求某列的和、平均值、最年夜值、最小值、行數方式

    方式/步調

    1. 1

      第一步sql語句求某列的和、平均值、最年夜值、最小值、行數,本家兒要用到sum,avg,max,min,count函數,這里以下面的表為例,如下圖所示:

    2. 2

      第二步求某列的和,輸入“SELECT sum(second) from test”語句,如下圖所示:

    3. 3

      第三步求某列的平均值,輸入“SELECT avg(second) from test”語句,如下圖所示:

    4. 4

      第四步求某列的最小值,輸入“SELECT min(second) from test”語句,如下圖所示:

    5. 5

      第五步求某列的最年夜值,輸入“SELECT max(second) from test”語句,如下圖所示:

    6. 6

      第六步求某列的行數,輸入“SELECT count(second) from test”語句,如下圖所示:

    注重事項

    • 若是你感覺這篇對你有效的話,請投一下票
    • 發表于 2018-07-11 00:00
    • 閱讀 ( 697 )
    • 分類:其他類型

    你可能感興趣的文章

    相關問題

    0 條評論

    請先 登錄 后評論
    admin
    admin

    0 篇文章

    作家榜 ?

    1. xiaonan123 189 文章
    2. 湯依妹兒 97 文章
    3. luogf229 46 文章
    4. jy02406749 45 文章
    5. 小凡 34 文章
    6. Daisy萌 32 文章
    7. 我的QQ3117863681 24 文章
    8. 華志健 23 文章

    推薦文章

    聯系我們:uytrv@hotmail.com 問答工具
  • <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>
    久久久久精品国产麻豆