[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: [sqr-users] Summing/Sorting
- Subject: Re: [sqr-users] Summing/Sorting
- From: "George Jansen" <GJANSEN@aflcio.org>
- Date: Wed, 08 Jun 2005 08:56:56 -0400
- Delivery-date: Wed, 08 Jun 2005 07:58:22 -0500
- List-id: "This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions." <sqr-users.sqrug.org>
If you are using Oracle 8i and above, you can do this in SQL with the "analytic
functions":
SQL> select object_id
2 from (select object_id, sum(object_id) over (order by object_id) as osum
3 from user_objects)
4 where osum < 150000;
OBJECT_ID
----------
23133
23134
23135
23136
23137
>>> CGeorge@chubb.com 06/08/05 5:15 AM >>>
Forgive me for not scanning the archives for a solution to this problem,
but I'm not really sure of a succint enough search term.
However, I feel that this is a problem that must have been explored by
someone at some time.
I'm looking for a routine that will, from a list of numbers, sum together
combinations of those numbers until a user defined total is reached and
then present those numbers that have been selected to sum to that total.
Any pointers greatfuly received.
Rgds.,
CG
---
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users