Please start any new threads on our new 
    site at https://forums.sqlteam.com.  We've got lots of great SQL Server
    experts to answer whatever question you can come up with.
    
        | 
                
                    | 
                            
                                | Author | Topic |  
                                    | Swati JainPosting Yak  Master
 
 
                                        139 Posts | 
                                            
                                            |  Posted - 2007-10-31 : 06:47:47 
 |  
                                            | select Sum(TotalValue) as GrandTotalValue,Sum(Rvalue) as GrandRValue,Sum(QRvalue)as InvoiceValuefrom @Resultgroup by   TotalValue, Rvalue,QRvalue    Where TotalValue, Rvalue,QRvalue  are columns of temprory table for which values are calculated with cursorBut I dont get the Sum as given in above query rather i get separate rows.How to resolve the issue? |  |  
                                    | madhivananPremature Yak Congratulator
 
 
                                    22864 Posts | 
                                        
                                          |  Posted - 2007-10-31 : 06:55:28 
 |  
                                          | quote:Then dont use Group by clauseMadhivananFailing to plan is Planning to failOriginally posted by Swati Jain
 select Sum(TotalValue) as GrandTotalValue,Sum(Rvalue) as GrandRValue,Sum(QRvalue)as InvoiceValuefrom @Resultgroup by   TotalValue, Rvalue,QRvalue    Where TotalValue, Rvalue,QRvalue  are columns of temprory table for which values are calculated with cursorBut I dont get the Sum as given in above query rather i get separate rows.How to resolve the issue?
 
 |  
                                          |  |  |  
                                |  |  |  |