Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Posts
    7

    Question Unanswered: Sumarize a column in a able

    hi,

    Is there any SQL query to cumilative add a field of a table for every row. For example i have this

    iID iAmount
    1 1000
    2 1500
    3 2000


    and the query should result in this

    iID iAmount iSum
    1 1000 1000
    2 1500 2500
    3 2000 4500

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Sumarize a column in a able

    In Oracle that would be:

    select iid, iamount, sum(iamount) over (order by iid) isum
    from ...;

  3. #3
    Join Date
    Nov 2003
    Posts
    7

    Re: Sumarize a column in a able

    Originally posted by andrewst
    In Oracle that would be:

    select iid, iamount, sum(iamount) over (order by iid) isum
    from ...;
    Thanks,


    Nasos

Posting Permissions

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