🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.comp.database
Article #54

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

#54
From: XWZ
Date: Fri, 21 Apr 2006 13:24
27 lines
2197 bytes
bndjskjdksjdsd
"С����(��)" <root@guohai.org.discuss> д����Ϣ����: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: <e2aoga$u16$1@news.cn99.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!newsfeed.media.kyoto-u.ac.jp!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!news2.google.com!newsfeed.media.kyoto-u.ac.jp!news.cn99.com!not-for-mail
From: "XWZ" <xwz841024@126.com>
Newsgroups: cn.comp.database,cn.fan,microsoft.public.cn.sqlserver
Subject: Re: ��select�����top������ʹ�ñ�����
Date: Fri, 21 Apr 2006 21:24:09 +0800
Organization: Bentium Ltd. (CN99)
Lines: 29
Message-ID: <e2aoga$u16$1@news.cn99.com>
References: <441de15c.10549329@cnusenet.3322.org>
NNTP-Posting-Host: 222.177.116.179
X-Trace: news.cn99.com 1145627978 30758 222.177.116.179 (21 Apr 2006 13:59:38 GMT)
X-Complaints-To: usenet@news.cn99.com
NNTP-Posting-Date: Fri, 21 Apr 2006 13:59:38 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869