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

相关文章:

  • 2021-11-21
  • 2022-12-23
  • 2021-05-28
  • 2022-12-23
  • 2021-05-17
  • 2021-08-31
  • 2021-06-05
  • 2021-08-26
猜你喜欢
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2022-12-23
  • 2022-01-20
相关资源
相似解决方案