🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.comp.database
Article #33

��select�����top������ʹ�ñ�����

#33
From: ����(��)
Date: Sun, 19 Mar 2006 04:44
25 lines
2266 bytes
���봴������һ���洢��̵�˵��
������: ��Ϣ 170������ 15��״̬ 1����� pageview���� 8
�� 8 ��: '@pagesize' �������﷨����
������: ��Ϣ 170������ 15��״̬ 1����� pageview���� 12
�� 12 ��: '@pagesum' �������﷨����
Ӧ����ô�������
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
create proc pageview
	@pagenum int=1,
	@pagesize int=10
as
declare @pagesum int
set @pagesum = @pagenum * @pagesize

select top @pagesize
gbook.[id],gbook.title,gbook.neirong,[user].[name],[user].[id]
from gbook inner join [user] 
on gbook.u_id =[user].[id]
WHERE (gbook.[id] NOT IN 
(SELECT TOP @pagesum gbook.[id] 
from gbook inner join [user] 
on gbook.u_id =[user].[id] 
ORDER BY gbook.[id] desc)) 
ORDER BY gbook.[id] desc
go
Technical Details
Message-ID: <441de15c.10549329@cnusenet.3322.org>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!198.186.190.247.MISMATCH!news-out.readnews.com!news-xxxfer.readnews.com!panix!newsfeed.media.kyoto-u.ac.jp!news.cn99.com!news.yaako.com!cnusenet.3322.org!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 1106d1,1421f408f40b2353,start
X-Google-Thread: 107c7f,1421f408f40b2353,start
X-Google-Thread: 104772,1421f408f40b2353,start
X-Google-Attributes: gid1106d1,gid107c7f,gid104772,public
X-Google-Language: Chinese,GB
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!198.186.190.247.MISMATCH!news-out.readnews.com!news-xxxfer.readnews.com!panix!newsfeed.media.kyoto-u.ac.jp!news.cn99.com!news.yaako.com!cnusenet.3322.org!not-for-mail
From: "����(��)" <root@guohai.org.discuss>
Newsgroups: cn.comp.database,cn.fan,microsoft.public.cn.sqlserver
Subject: ��select�����top������ʹ�ñ�����
Date: Sun, 19 Mar 2006 12:44:49 +0800
Organization: news://cnusenet.3322.org
Lines: 25
Message-ID: <441de15c.10549329@cnusenet.3322.org>
NNTP-Posting-Host: 60.22.215.121
Mime-Version: 1.0
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: 8bit
X-Trace: news.yaako.com 1142743481 5879 60.22.215.121 (19 Mar 2006 04:44:41 GMT)
X-Complaints-To: usenet@news.yaako.com
NNTP-Posting-Date: Sun, 19 Mar 2006 04:44:41 +0000 (UTC)
X-Newsreader: Forte Agent 1.8/32.548
X-Original-NNTP-Posting-Host: 61.51.234.205
X-Original-Trace: 19 Mar 2006 12:44:37 +0800, 61.51.234.205