SQLServer 数据分栏

SQLServer 数据分栏,第1张

概述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,*

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 数据分栏所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1172726.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-02
下一篇 2022-06-02

发表评论

登录后才能评论

评论列表(0条)

保存