zoukankan      html  css  js  c++  java
  • MySql中limit的用法

    limit子句用于限制查询结果返回的数量

    格式:

    select * from tableName limit i,n

    • tableName:表名
    • i:为查询结果的索引值(默认从0开始),当i=0时可省略i
    • n:为查询结果返回的数量
    • i与n之间使用英文逗号","隔开

    Example:

    1. select * from Customer LIMIT 10;

    检索前10行数据,显示1-10条数据

    1. select * from Customer LIMIT 1,10;

    检索从第2行开始,累加10条id记录,共显示id为2….11

    1. select * from Customer limit 5,10;

    检索从第6行开始向前加10条数据,共显示id为6,7….15

    1. select * from Customer limit 6,10;

    检索从第7行开始向前加10条记录,显示id为7,8…16

    注意:

    limit n 等同于 limit 0,n

  • 相关阅读:
    前缀和
    hdu6290奢侈的旅行
    make_pair
    New Year and Buggy Bot
    STL next_permutation 算法原理和自行实现
    前端面试题集合
    node设置cookie
    黑客与geek
    xss
    node async
  • 原文地址:https://www.cnblogs.com/coder-wf/p/13363678.html
Copyright © 2011-2022 走看看