Results 1 to 4 of 4

Thread: Cumulative Total

  1. #1
    Join Date
    Apr 2006
    Location
    Tamilnadu, India
    Posts
    2

    Cumulative Total

    Dear group,
    how to write a single sql query to display the fields of a table with cumulative total.

    table name - sales

    fields - item_code, supplier_code, sales_amount

    i need to display the result as
    item_code, supplier_code, sales_amount, cumulative_sales_amount

    the cumulative sales amount should be cumulative for all rows.

    with advance thanks

    --
    Sathish Kumar.S
    SpireTEK

  2. #2
    Join Date
    Apr 2006
    Posts
    3

  3. #3
    Join Date
    Apr 2006
    Location
    Tamilnadu, India
    Posts
    2

    Cumulative Total

    Thank you.
    But the correlated query takes too much of time for 70,000 records.
    I think using procedure do good.

    Sathish Kumar.S
    SpireTEK

  4. #4
    Join Date
    Apr 2006
    Posts
    3
    If you read the article, you'll see that correlated query is not the solution recommended there. There are a few better solution mentioned there.

Posting Permissions

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