分页
来源:互联网 发布:vue.js 数据绑定 编辑:程序博客网 时间:2024/05/01 23:52
-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: munaiwu
-- Create date: 20091030
-- Description: 公文分页存储过程
-- =============================================
CREATE PROCEDURE pagination1
-- Add the parameters for the stored procedure here
@pagesize int, --页面大小,如每页存储20条记录
@pageindex int ---当前页号
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON; --不返回计数,不返回任何结果集
-- Insert statements for procedure here
declare @indextable table(id int identity(1,1),nid int) --表变量
declare @PageLowerBound int --定义页面底码
declare @PageUpperBound int --定义页面顶码
set @PageLowerBound = (@pageindex - 1)* @pagesize
set @PageUpperBound = @PageLowerBound + @pagesize
set rowcount @PageUpperBound --在达到指定的行数后停止处理
insert into @indextable(nid) select gid from TGongwen where fariqi > dateadd(day,-365,getdate()) order by fariqi desc
select O.gid,O.mid,O.title,O.fadanwei,O.fariqi from TGongwen as O, @indextable as t where O.gid=t.nid and t.id>@PageLowerBound and t.id<=@PageUpperBound order by t.id
END
set nocount off --返回计数,返回任何结果集
GO
- 分页
- 分页
- 分页
- 分页
- 分页
- 分页
- 分页
- 分页
- 分页
- 分页
- 分页
- 分页
- 分页
- 分页
- 分页
- 分页
- 分页
- 分页
- javascript 动态插入行 表格操作
- 满足极高读写性能需求的Key-Value数据库
- 游戏引擎发展史
- C#连接Oracle数据库的简单应用
- asp.net客户端或服务端验证方式
- 分页
- ubuntu中找回mysql5.0遗失的root密码
- 优秀程序员应该有的习惯
- Hibernate初步
- WINDOWS SOCKET 重叠I/O 事件对象
- Distinct
- PTZ云台开发过程中PELCO-D、PELCO-P协议遇到的问题
- table border边框线虚线 隔行换色onmouse效果 div换色
- 如何在未加入域的机器上使用集成认证来登陆SQL Server