zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    day08
    day07
    day06
    day06
    day05
    第三次作业
    第三次作业
    第二次作业
    java 数字和日期处理
    jsp文件导包
  • 原文地址:https://www.cnblogs.com/zhuawang/p/1151107.html
Copyright © 2011-2022 走看看