理论
练习
sql
- LIMIT
select * from table LIMIT 5,10; 检索记录行6-15 (第一个参数指定第一个返回记录行的偏移量,第二个参数指定返回记录行的最大数目)
select * from table LIMIT 95,-1; 检索记录行96-last
select * from table LIMIT 5; 检索签5个记录行=select * from table limit 0,5;
分页(索引?)
select...from...where...ORDER BY...LIMIT...
https://www.cnblogs.com/xiaoshen666/p/10824117.html
https://blog.csdn.net/weixin_30379911/article/details/96259306
https://blog.csdn.net/myzksky/article/details/80620452
mysql的几种连接
- 笛卡尔积 cross join(cross join的时候是不需要on或者using关键字的,这个是区别于inner join和join的)
- 左连接 left join/left outer join
- 右连接 right join/right outer join
- 内连接 inner join(inner可以忽略)
- 左表独有 where b.xx=null
- 右表独有 where a.xx=null
- 全连接 union
oracle中有full join,mysql中没有full join,但可以用union实现 - 并集去交集
锁
链接