SQL语句执行顺序及MySQL中limit的用法

来源:互联网 发布:牛牛机器人软件 编辑:程序博客网 时间:2024/05/16 17:39
写的顺序:select ... from... where.... group by... having... order by..
执行顺序:from... where...group by... having.... select ... order by...


MYSQL中:


写的顺序:select ... from... where.... group by... having... order by.. limit [offset,] (rows)
执行顺序:from... where...group by... having.... select ... order by... limit


limit限制查询的结果序号 
limit off, n: 从off偏移取n个数据
limit n: 取前n个数据,相当于limit 0, n
原创粉丝点击