博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mysql 数据操作 单表查询 limit 练习
阅读量:5346 次
发布时间:2019-06-15

本文共 3040 字,大约阅读时间需要 10 分钟。

 

 

1. 分页显示,每页5条
mysql> select * from employee  limit 0,5;+----+------------+--------+-----+------------+---------+--------------+------------+--------+-----------+| id | name       | sex    | age | hire_date  | post    | post_comment | salary     | office | depart_id |+----+------------+--------+-----+------------+---------+--------------+------------+--------+-----------+|  1 | alex       | male   |  78 | 2015-03-02 | teacher | NULL         | 1000000.31 |    401 |         1 ||  2 | yuanhao    | male   |  73 | 2014-07-01 | teacher | NULL         |    3500.00 |    401 |         1 ||  3 | liwenzhou  | male   |  28 | 2012-11-01 | teacher | NULL         |    2100.00 |    401 |         1 ||  4 | jingliyang | female |  18 | 2011-02-11 | teacher | NULL         |    9000.00 |    401 |         1 ||  5 | jinxin     | male   |  18 | 1900-03-01 | teacher | NULL         |   30000.00 |    401 |         1 |+----+------------+--------+-----+------------+---------+--------------+------------+--------+-----------+5 rows in set (0.00 sec)mysql> select * from employee  limit 5,5;+----+--------+--------+-----+------------+---------+--------------+----------+--------+-----------+| id | name   | sex    | age | hire_date  | post    | post_comment | salary   | office | depart_id |+----+--------+--------+-----+------------+---------+--------------+----------+--------+-----------+|  6 | 成龙   | male   |  48 | 2010-11-11 | teacher | NULL         | 10000.00 |    401 |         1 ||  7 | 歪歪   | female |  48 | 2015-03-11 | sale    | NULL         |  3000.13 |    402 |         2 ||  8 | 丫丫   | female |  38 | 2010-11-01 | sale    | NULL         |  2000.35 |    402 |         2 ||  9 | 丁丁   | female |  18 | 2011-03-12 | sale    | NULL         |  1000.37 |    402 |         2 || 10 | 星星   | female |  18 | 2016-05-13 | sale    | NULL         |  3000.29 |    402 |         2 |+----+--------+--------+-----+------------+---------+--------------+----------+--------+-----------+5 rows in set (0.00 sec)mysql> select * from employee  limit 10,5;+----+-----------+--------+-----+------------+-----------+--------------+----------+--------+-----------+| id | name      | sex    | age | hire_date  | post      | post_comment | salary   | office | depart_id |+----+-----------+--------+-----+------------+-----------+--------------+----------+--------+-----------+| 11 | 格格      | female |  28 | 2017-01-27 | sale      | NULL         |  4000.33 |    402 |         2 || 12 | 张野      | male   |  28 | 2016-03-11 | operation | NULL         | 10000.13 |    403 |         3 || 13 | 程咬金    | male   |  18 | 1997-03-12 | operation | NULL         | 20000.00 |    403 |         3 || 14 | 程咬银    | female |  18 | 2013-03-11 | operation | NULL         | 19000.00 |    403 |         3 || 15 | 程咬铜    | male   |  18 | 2015-04-11 | operation | NULL         | 18000.00 |    403 |         3 |+----+-----------+--------+-----+------------+-----------+--------------+----------+--------+-----------+5 rows in set (0.00 sec)

 

 

转载于:https://www.cnblogs.com/mingerlcm/p/9891056.html

你可能感兴趣的文章
java 利用Future做超时任务处理
查看>>
【UIKit】UITableView.03
查看>>
myeclipse10 与myeclipse2017可以并存
查看>>
C语言 const与指针
查看>>
磁盘文件系统RAW文件怎样恢复
查看>>
第二章 测试环境搭建(下)
查看>>
go语言学习基础-编译文件
查看>>
前端网址搜藏
查看>>
bzoj2456 mode
查看>>
【Python之路Day1】基础篇
查看>>
wordpress stratus模板使用 产品显示问题
查看>>
第一课:网络爬虫准备
查看>>
IE8 input X 去掉文本框的叉叉和密码输入框的眼睛图标
查看>>
C#内联汇编的一个类
查看>>
AFNetworking 显示不支持“Content-Type:text/plain”的解决方法
查看>>
[WPF] 将普通的Library工程,改造成WPF Custom Control 的Library
查看>>
2019春第十一周作业
查看>>
深入浅出SharePoint——无法搜索当前站点的数据
查看>>
js的线程和同步异步以及console.log机制
查看>>
JavaScript 框架比较
查看>>