标签:部分 方便 语法 分页 指定 art -- tin 行数据
select 列1,列2,聚合... from 表名 group by 列1,列2,列3...
select gender as 性别,count(*)
from students
group by gender;
select hometown as 家乡,count(*)
from students
group by hometown;
select 列1,列2,聚合... from 表名
group by 列1,列2,列3...
having 列1,...聚合...
方案一
select count(*)
from students
where gender=1;
-----------------------------------
方案二:
select gender as 性别,count(*)
from students
group by gender
having gender=1;
select * from 表名
order by 列1 asc|desc,列2 asc|desc,...
select * from students
where gender=1 and isdelete=0
order by id desc;
select * from subject where isdelete=0 order by stitle;
select * from 表名
limit start,count
select * from students where isdelete=0 limit (n-1)*m,m
select distinct *
from 表名
where ....
group by ... having ...
order by ...
limit star,count
标签:部分 方便 语法 分页 指定 art -- tin 行数据
原文地址:https://www.cnblogs.com/leecoffee/p/9037972.html