Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Posts
    8

    Unanswered: Getting Cumulative results through SQL

    Hi All

    I have a column1 in table1 in a ACCESS 2000 Database with the following data.

    COLUMN1: EXPECTEDOUPUT
    5 5
    8 13
    3 16
    4 20
    3 23


    I need to get the cumulative sum of Column1.I am free to use any temporary tables or columns in my database ,but the finally the output i need is the EXPECTEDCOLUMN.

    Is there any way to achieve this by using SQLs which handle some cumulative aggregate functions

    Thanks in advance
    Krithika Varadarajan

  2. #2
    Join Date
    Jun 2003
    Location
    Minnesota
    Posts
    61
    you can make a WHERE loop after connecting to your database and selecting column one:

    while ($Row = mysql_fetch_array($result)) {
    $sum = $sum+$Row[column1];
    }

    echo $sum
    Mr. Lars

Posting Permissions

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