🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.comp.database
Article #38

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

#38
From: element
Date: Sun, 19 Mar 2006 14:35
38 lines
2488 bytes
create proc pageview
@pagenum int=1,
@pagesize int=10
as
declare @pagesum int
set @pagesum = @pagenum * @pagesize

declare @sql varchar(8000)
set @sql='select top '+cast(@pagesize as varchar)+' 
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 '+cast(@pagesum as varchar)+' 
gbook.[id] from gbook inner join [user] on gbook.u_id =[user].[id]
ORDER BY gbook.[id] desc))
ORDER BY gbook.[id] desc'
exec(@sql)
go


"С����(��)" <root@guohai.org.discuss> д����Ϣ����:441d65de.8568400@cnusenet.3322.org...
> զ����̬������
> ��Sun, 19 Mar 2006 21:28:39 +0800ʱ,"element"�� ��Re:
> ��select�����top������ʹ�ñ����� ���з���Ĵ���:
> --
>
>>�ö�̬SQL
>>
>>"С����(��)" <root@guohai.org.discuss> д����Ϣ����:441d4541.219355@cnusenet.3322.org...
>>> ���ҵ�SQL��2000զ�찡��
>>> ��Sun, 19 Mar 2006 19:21:36 +0800ʱ,"Yanni"�� ��Re:
>>> ��select�����top������ʹ�ñ����� ���з���Ĵ���:
>>> --
>>>
>>>>2005��֧�֡�
>>>>
>>>
>>
> 
Technical Details
Message-ID: <ujQxeJ2SGHA.5728@tk2msftngp13.phx.gbl>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed00.sul.t-online.de!t-online.de!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
References: <441de15c.10549329@cnusenet.3322.org> <dvjes0$v2c$1@news.yaako.com> <441d4541.219355@cnusenet.3322.org> <#Ms1Kk1SGHA.1868@TK2MSFTNGP09.phx.gbl> <441d65de.8568400@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: ENGLISH,ASCII
From: "element" <songmc1982@163.com>
References: <441de15c.10549329@cnusenet.3322.org> <dvjes0$v2c$1@news.yaako.com> <441d4541.219355@cnusenet.3322.org> <#Ms1Kk1SGHA.1868@TK2MSFTNGP09.phx.gbl> <441d65de.8568400@cnusenet.3322.org>
Subject: Re: ��select�����top������ʹ�ñ�����
Date: Sun, 19 Mar 2006 22:35:26 +0800
Lines: 40
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Original
Message-ID: <ujQxeJ2SGHA.5728@tk2msftngp13.phx.gbl>
Newsgroups: cn.comp.database,cn.fan,microsoft.public.cn.sqlserver
NNTP-Posting-Host: 221.217.86.200
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed00.sul.t-online.de!t-online.de!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl