文章分类 -  转载文章

从数据表中取出第n条到第m条的记录的方法
摘要:select top 页大小 *from table1 where id> (select max (id) from (select top ((页码-1)*页大小) id from table1 order by id) as T ) order by id 从publish 表中取出第 n 条到第 m 条的记录: SELECT TOP m-n+... 阅读全文

posted @ 2006-09-09 11:52 zqonline 阅读(165) 评论(0) 推荐(0)

如何在定义游标的时候使用动态sql语句?
摘要:这样写是错的 declare @qa nvarchar(200)declare @i intdeclare @sql nvarchar(255)set @i = 1while @i <= 5 begin set @sql = 'select q' + convert(nvarchar(2), @i) + ' from ImportSurveyInfo' set @i = @i + 1 decl... 阅读全文

posted @ 2006-09-09 11:51 zqonline 阅读(372) 评论(0) 推荐(0)

导航