sql语句分页,并返回总行数

Select '备品备件' As WLlb,sb.Number As sbNumber,sb.Name As SbName,
sbgg.Name As sbGGName,sb.Unit As SbUnit,
bm.GroupName As sbGroupName,
fc.GroupName As fcRranch,
Sum(cgmx.Num) As SumNum,Sum(sbinfo.BuyPrice) As SumPrice
From E_PurchaseDetail cgmx
Inner Join E_Purchase cgd on cgd.PurchaseID=cgmx.PurchaseID
Left Join DevInfo sbinfo on sbinfo.DevInfoID=cgmx.DevID
Left Join Dev sb on sb.DevID=sbinfo.DevID
Left Join model sbgg on sbgg.ModelID=sb.ModelID
Left Join S_Depart bm on bm.GroupID=cgd.ApplyGroupID collate Chinese_PRC_90_CI_AI
Left Join S_Depart fc on fc.GroupID = SUBSTRING(bm.GroupID,1,3)+'00000'
Where cgd.IsDev=1 And cgmx.Status=1
And cgd.ApplyDate between '2014-01-01' and '2015-07-30'
And cgd.ApplyGroupID Like '%'+ SUBSTRING('K0107000',1,3) +'%'
Group By sb.Number,sb.Name,sbgg.Name,sb.Unit,bm.GroupName,fc.GroupName

求大神帮帮忙,把以上sql语句修改为分页,并且返回总行数。

2个回答

分页不是在sql上面实现的,显示界面来控制啊

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐