CREATE PROCEDURE [dbo].[dxd_mx] @dxd_ID VARCHAR(120)='' AS BEGIN --set nocount on declare @sql1 nVARCHAR(4000) SET @sql1='select * from (SELECT ROW_NUMBER() OVER(ORDER BY t1.n ASC) AS m1,* from (SELECT ROW_NUMBER() OVER(ORDER BY ID DESC) AS n,ID,dxd_ID,yqs,yhs,guanghao FROM lxcy_dxd_mx_v WHERE dxd_ID='''+@dxd_ID+''' or dxd_ID='''') t1 WHERE n<=30)tt1 left JOIN (SELECT ROW_NUMBER() OVER(ORDER BY t2.n ASC) AS m2,guanghao FROM lxcy_dxd_mx_v WHERE dxd_ID='''+@dxd_ID+''' or dxd_ID='''') t2 WHERE n BETWEEN 31 AND 60)tt2 on m1=m2' EXEC sp_executesql @sql1 RETURN END
总结以上是内存溢出为你收集整理的SQLServer 数据分栏全部内容,希望文章能够帮你解决SQLServer 数据分栏所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)