Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2003
    Location
    kualalumpur
    Posts
    89

    Unanswered: 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

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    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

  3. #3
    Join Date
    Mar 2004
    Location
    Fort Worth, Texas, USA
    Posts
    68
    Investige ROLLUP and CUBE, but generally I agree with Pat.

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Nov 2003
    Location
    kualalumpur
    Posts
    89
    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..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •