随笔 - 159  文章 - 1  评论 - 198 
CREATE PROCEDURE usp_liuyanquery
(
  
     @PageLowerBound INT, 
     @PageUpperBound INT,
     @Answer varchar(
500
)
as
begin

declare @indextable table(id 
int identity(1,1),nid int)  --定义表变量

insert into @indextable(nid) select id from liuyan_T where answer like 
'%'+@Answer+'%' or content  like '%'+@Answer+'%'

select  d.id,d.name,d.type,d.E_mail,d.zhuye,d.qicq,d.content,d.createtime,d.answer,d.Reverter  from liuyan_T  d,
@indextable t where (d.id
=t.nid)
and t.id
>@PageLowerBound and t.id<=@PageUpperBound  order by t.id desc
end

GO
主要就是把你要查询的表生成另一个表
posted on 2006-06-24 10:04 过江 阅读(59) 评论(0)  编辑 收藏 所属分类: asp.net2003 C#经典方法

标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      


相关链接: