If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > summation of group data

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-10-04, 01:33
sridharreddy_d sridharreddy_d is offline
Registered User
 
Join Date: Nov 2003
Location: kualalumpur
Posts: 89
summation of group data

hello sql developers..
Iam using cfml for report generation.
In a report the record set returned by a query must be formatted in the following way.
records r grouped on a column(say batchid).
at the end of each recordset for a particular group the summary of a column values must be displayed.and the report should continue in the same format.

like..
batchid---c1---c2---nofrec
10---aa---bb---125
10---zz-ss---35
10---lll---dd---20
total records---180
20---ii---ee---55
20--yy-qq-35
total records---90
.......
........
can something be done on sql side ..if yes. ..
please help me in doing this..
thanks in advance
Reply With Quote
  #2 (permalink)  
Old 03-10-04, 11:57
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
While group total reporting can be done in SQL, it is better done on the client. The steps needed to generate the SQL are rather hokey, not a pretty sight!

-PatP
Reply With Quote
  #3 (permalink)  
Old 03-13-04, 11:16
actuary actuary is offline
Registered User
 
Join Date: Mar 2004
Location: Fort Worth, Texas, USA
Posts: 68
Investige ROLLUP and CUBE, but generally I agree with Pat.
Reply With Quote
  #4 (permalink)  
Old 03-13-04, 17:01
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
pat is right, it should be done on the clilent

there is a clear and simple coldfusion solution

http://www.dbforums.com/t987601.html

you see, sridharreddy_d, this is why you should not cross-post, you get a whole raft of people attempting to help you, and many of the answers will be conflicting
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 03-15-04, 03:52
sridharreddy_d sridharreddy_d is offline
Registered User
 
Join Date: Nov 2003
Location: kualalumpur
Posts: 89
Quote:
Originally posted by r937
pat is right, it should be done on the clilent

there is a clear and simple coldfusion solution

http://www.dbforums.com/t987601.html

you see, sridharreddy_d, this is why you should not cross-post, you get a whole raft of people attempting to help you, and many of the answers will be conflicting
Thanks all.. I could get that using cfml..
Anyway .. I'll try CUBE and ROLLUP too..
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On