Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9117075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:49:22+00:00 2026-06-17T04:49:22+00:00

I am using an older version of sybase which does not have keywords like

  • 0

I am using an older version of sybase which does not have keywords like lead.

I want to find cumulative left over.

Let me try to explain this with an example.

StartQuantity = 500

Category   Time        Quantity        LeftOver
cat1      10:01:01.000     100           400 
cat1      10:01.01.001     50            350
cat1      10:01:01.002      0            350
cat1      10:01.01.003    100            250
cat1      10:01:03.001    100            150

Similar rows are available in cat2 and the number of rows per category is variable.

Please note that in above I have arranged the rows in ascending order of time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T04:49:24+00:00Added an answer on June 17, 2026 at 4:49 am

    I don’t know if Sybase supports this, but in PostgreSQL, Oracle and others you can do

    select category,
           time,
           quantity, 
           500 - sum(quantity) over (partition by category order by time) as leftover
    from the_unknown_table;
    order by category, time
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using an older version of sybase which does not have keywords like
I am using an older version of SQL Server (2000). I do not want
I have a drag and drop script using an older version of jquery which
I am using an older version of Xcode - 3.1.3. and want to install
Previously I've been using some older version of django-registration which seems to be deprecated
I am currently using an older version of Umbraco (4.03) and I have several
I have been using the older version of analytics code and used the following
This code (by someone else) might have been written using an older version of
First off, I'm using an older version of Restlet (1.1). Secondly, I'm not sure
I am stuck using the older version (2.2.1) of Jython on the machines I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.