• sql server2005分页存储过程


    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    go

    -- =============================================
    -- Author:  王再华
    -- Create date: 2008.4.13
    -- Description: 分页存储过程
    -- =============================================
    ALTER PROCEDURE [dbo].[Gbook_SP_GetBookPager]
    @PageSize int, --每页显示数
    @PageIndex int, --页索引
    @Count int output  --总页数
    AS
    BEGIN
    select @Count=count(*) from book where id<10  -- 查询条件

    select * from( 
        select *, ROW_NUMBER() OVER(order by id) as row from book   where id<10  -- 查询条件
    ) a 
    where row between (@PageSize*(@PageIndex-1)+1) and @PageSize*@PageIndex
    END

  • 相关阅读:
    HDU 1002 A + B Problem II
    leetcode 42.接雨水
    无向图 及其术语
    C++优先队列详解
    C++优先队列详解
    最短路
    最短路
    CF DP练习题
    CF DP练习题
    干货
  • 原文地址:https://www.cnblogs.com/zhuawang/p/1151107.html
Copyright © 2020-2023  润新知