第6条开始分页,第page页:select * from 表 where 条件order by 顺序 limit ((page-1)*20+5),20(第((page-1)*20+5)行开始,取20条)
如果是mssql,麻烦一点:前五条 select top 5 * from 表 where 条件 order by 顺序 (取前5条)
第6条开始分页,第page页:
select top 20 * from 表 where 条件 and id not in (
select top ((page-1)*20+5) id from 表 where 条件 order by 顺序
) order by 顺序 (两个条件,顺序相同)
mysql>select (8+2)*(3-2)/3+---------------+
| (8+2)*(3-2)/3 |
+---------------+
|3.3333 |
+---------------+
mysql>select 10 div 3 % 2
+--------------+
| 10 div 3 % 2 |
+--------------+
|1 |
+--------------+
1.2 逻辑运算符
>,>=,<,<=,!=,<>,=,<=>
between,not between,in,not in
like,regexp
is null,is not null
1.3 位运算符
|,&,~,<<,>>,^
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)