🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.comp.database
Article #47

Re: ��select�����top������ʹ�ñ�����

#47
From: guocai
Date: Thu, 20 Apr 2006 03:17
28 lines
2238 bytes
����C�������
����(��) <root@guohai.org.discuss> wrote in message
news:441de15c.10549329@cnusenet.3322.org...
> ���봴������һ���洢��̵�˵��
> ������: ��Ϣ 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: <e270lg$qge$1@news.cn99.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed01.sul.t-online.de!t-online.de!news.cn99.com!not-for-mail
References: <441de15c.10549329@cnusenet.3322.org>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1106d1,1421f408f40b2353
X-Google-Thread: 107c7f,1421f408f40b2353
X-Google-Thread: 104772,1421f408f40b2353
X-Google-Attributes: gid1106d1,gid107c7f,gid104772,public
X-Google-Language: Chinese,GB
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed01.sul.t-online.de!t-online.de!news.cn99.com!not-for-mail
From: "guocai" <guocaixi@163.com>
Newsgroups: cn.comp.database,cn.fan,microsoft.public.cn.sqlserver
Subject: Re: ��select�����top������ʹ�ñ�����
Date: Thu, 20 Apr 2006 11:17:26 +0800
Organization: Bentium Ltd. (CN99)
Lines: 30
Message-ID: <e270lg$qge$1@news.cn99.com>
References: <441de15c.10549329@cnusenet.3322.org>
NNTP-Posting-Host: 222.177.116.179
X-Trace: news.cn99.com 1145505264 27150 222.177.116.179 (20 Apr 2006 03:54:24 GMT)
X-Complaints-To: usenet@news.cn99.com
NNTP-Posting-Date: Thu, 20 Apr 2006 03:54:24 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200