mysql知识点

阎小妍

关注

阅读 75

2022-04-02

理论

练习

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的几种连接

  1. 笛卡尔积 cross join(cross join的时候是不需要on或者using关键字的,这个是区别于inner join和join的)
  2. 左连接 left join/left outer join
  3. 右连接 right join/right outer join
  4. 内连接 inner join(inner可以忽略)
  5. 左表独有 where b.xx=null
  6. 右表独有 where a.xx=null
  7. 全连接 union
    oracle中有full join,mysql中没有full join,但可以用union实现
  8. 并集去交集

链接

精彩评论(0)

0 0 举报