欧美亚洲中文,在线国自产视频,欧洲一区在线观看视频,亚洲综合中文字幕在线观看

      1. <dfn id="rfwes"></dfn>
          <object id="rfwes"></object>
        1. 站長資訊網(wǎng)
          最全最豐富的資訊網(wǎng)站

          MySQL分組后,如何統(tǒng)計(jì)記錄條數(shù)

          MySQL分組后,統(tǒng)計(jì)記錄條數(shù)的方法:1、統(tǒng)計(jì)記錄條數(shù),代碼為【SELECT num,count(*) AS counts from test_a GROUP BY num】;2、對(duì)num去重后的數(shù)量的統(tǒng)計(jì)。

          MySQL分組后,如何統(tǒng)計(jì)記錄條數(shù)

          MySQL分組后,統(tǒng)計(jì)記錄條數(shù)的方法:

          分組后,統(tǒng)計(jì)記錄條數(shù):

          SELECT num,count(*) AS counts from test_a GROUP BY num;

          查詢結(jié)果如下:

          MySQL分組后,如何統(tǒng)計(jì)記錄條數(shù)

          對(duì)num去重后的數(shù)量的統(tǒng)計(jì):

            SELECT count(t.counts) FROM ( SELECT num,count(*) AS counts from test_a GROUP BY num ) AS t;   SELECT count(DISTINCT num) AS count FROM test_a;

            它倆結(jié)果一樣,都是5;只是一個(gè)是子查詢(嵌套),一個(gè)是內(nèi)置函數(shù) distinct();

          數(shù)據(jù)庫結(jié)構(gòu)

          MySQL分組后,如何統(tǒng)計(jì)記錄條數(shù)

          贊(0)
          分享到: 更多 (0)
          網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)