mysql笔记--group by,limit用法

table:
id tag status
1   a     0
2   b      0
3    c     1
4    d    1


一、group by用法
    1.与count 联合计数
           select status,count(*)
          from table
           group by status

status count(*)
0 2
1 2
2.与 group_concat联合使用 select status,group_concat(tag) as tag from table group by status
status tag
0 a,b
1 c,d
二、limit用法
    1.分页
        设页数为page ,每页记录为a

      select *
      from table    
      limit (page-1)*a
View Code
原文地址:https://www.cnblogs.com/fwdqxl/p/7706848.html