首页 新闻 搜索 专区 学院

TSQL 去除分页语句的分页工能

0
悬赏园豆:50 [已关闭问题] 关闭于 2013-04-24 12:10

SELECT fun_getareaName(areaid)  prevAreaName, AreaName,HospitalName,NVL(Levels,'')||NVL(LevelDetail,'') Levels,Nature, case CountyOver when 1 then '县级以上' Else '' end  CountyOver,B.HospitalID,PurchaseAmountTotal, WareHouseAmountTotal, DistributeAmountTotal, PurchaseCountTotal,DistributeCountTotal, WareHouseCountTotal,ReturnhouseCountTotal,ReturnhouseAmountTotal,CanclePurchaseCount,
                               CanclePurchaseAmount,
                               WebMiningCountTotal,
                               WebMiningAmountTotal,
                               InvoiceCountTotal,
                               InvoiceAmountTotal,
                               SettlementCountTotal,
                               SettlementAmountTotal  FROM View_HospitalArea  left JOIN (select A.HospitalID,PurchaseAmountTotal, WareHouseAmountTotal, DistributeAmountTotal,PurchaseCountTotal,DistributeCountTotal, WareHouseCountTotal,ReturnhouseCountTotal,ReturnhouseAmountTotal,CanclePurchaseCount,
                               CanclePurchaseAmount,
                               WebMiningCountTotal,
                               WebMiningAmountTotal,
                               InvoiceCountTotal,
                               InvoiceAmountTotal,
                               SettlementCountTotal,
                               SettlementAmountTotal from(SELECT HospitalID,SUM(PurchaseAmount)  PurchaseAmountTotal,SUM(WarehouseAmount)  WareHouseAmountTotal,SUM(PurchaseCount) PurchaseCountTotal, SUM(DistributeCount) DistributeCountTotal, SUM(WareHouseCount) WareHouseCountTotal,SUM(DistributeCount*Price)  DistributeAmountTotal FROM View_Supervise  WHERE 1=1 and PurchaseCount>0  and OrderStatus ='1' and Orderdetailstate not in (100,110,0)   AND AreaID LIKE '15%'  GROUP BY HospitalID) A LEFT JOIN (SELECT abs(sum(WareHouseCount)) ReturnhouseCountTotal,abs(sum(WarehouseAmount)) ReturnhouseAmountTotal,HospitalID FROM View_Supervise WHERE 1=1 and PurchaseCount<0  AND (OrderStatus ='1' and Orderdetailstate not in (100,110,0) and AreaID LIKE '15%') GROUP BY HospitalID) C ON C.HospitalID  = A.HospitalID  LEFT JOIN (SELECT abs(sum(PurchaseCount)) CanclePurchaseCount,
                                                        abs(sum(PurchaseAmount)) CanclePurchaseAmount,
                                                        HospitalID
                                                   FROM View_Supervise_tb
                                                  WHERE 1 = 1
                                                    and Orderdetailstate = 4
                                                  GROUP BY HospitalID) D
                                         ON D.HospitalID = A.HospitalID
                                       LEFT JOIN (SELECT abs(sum(SettleCount)) WebMiningCountTotal,
                                                        abs(sum(SettleCount * Price)) WebMiningAmountTotal,
                                                        HospitalID
                                                   FROM View_Supervise_tb
                                                  WHERE 1 = 1
                                                    and Orderdetailstate in (160, 170)
                                                  GROUP BY HospitalID) E
                                         ON E.HospitalID = A.HospitalID
                                       LEFT JOIN (SELECT abs(sum(SettleCount)) InvoiceCountTotal,
                                                        abs(sum(SettleCount * Price)) InvoiceAmountTotal,
                                                        HospitalID
                                                   FROM view_invoicedistribution
                                                  WHERE 1 = 1
                                                    and auditstatus = 1
                                                  GROUP BY HospitalID) F
                                         ON F.HospitalID = A.HospitalID
                                       LEFT JOIN (SELECT abs(sum(SettleCount)) SettlementCountTotal,
                                                        abs(sum(SettleCount * Price)) SettlementAmountTotal,
                                                        HospitalID
                                                   FROM View_Supervise_tb
                                                  WHERE 1 = 1
                                                    and Orderdetailstate = 170
                                                  GROUP BY HospitalID) G
                                         ON G.HospitalID = A.HospitalID) B ON View_HospitalArea.HospitalID = B.HospitalID where 1=1  AND AreaID LIKE '15%'  ORDER BY areaid ASC,hospitalid  求解怎么把这条语句的的分页去掉

落花〆、春雨鸣的主页 落花〆、春雨鸣 | 初学一级 | 园豆:3
提问于:2013-04-24 11:29
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册