Home > Database > Mysql Tutorial > sql server 2005 万能分页存储过程

sql server 2005 万能分页存储过程

WBOY
Release: 2016-06-07 17:45:10
Original
883 people have browsed it

sqlserver2005中的万能分页存储过程。建立主表临时表 CREATE TABLE #temp(rownumber bigint,orderseqno VARCHAR(36),goodsname VARCHAR(50),companyname VARCHAR(100))建立子表临 时表CREATE TABLE #detail(orderseqno VARCHAR(36),detailid UNIQUEIDENTIFIE

sqlserver2005中的万能分页存储过程。–建立主表临时表

CREATE TABLE #temp ( rownumber bigint, orderseqno VARCHAR(36), goodsname VARCHAR(50), companyname VARCHAR(100) ) –建立子表临 时表 CREATE TABLE #detail ( orderseqno VARCHAR(36), detailid UNIQUEIDENTIFIER, unitprice DECIMAL(12,2), Qty int ) –插入主表数据到主表临时表 insert into #temp SELECT oo.rownumber, oo.OrderSeqNO, oo.GoodsName, oo.CompanyName FROM (SELECT ROW_NUMBER () OVER (ORDER BY oi.createdate DESC) AS rownumber, oi.OrderSeqNO, oi.GoodsName ,ci.CompanyName FROM OrderInfo oi INNER JOIN CompanyInfo ci ON oi.CompanyID=ci.CompanyID WHERE oi.CreateDate

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template