常用数据库分页查询语句

    xiaoxiao2021-03-30  32

    1.orcale,sqlserver,mysql数据库常用分页查询 orcale

    select * from ( select a.*,rownum nu from (select * from table)a where rownum<20 )where nu>5 查询第6条到第19记录

    sqlserver

    select top 10 * from table where id not in ( select top 5 id from table ) 查询第6条到第15记录

    mysql

    select * from table limt 20,5

    查询第21条到第25记录

    转载请注明原文地址: https://ju.6miu.com/read-665086.html

    最新回复(0)