× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Tim,

I think what you are looking for is a sub-select in your from clause.
It works
pretty well for a level or two. To try this out use something like:

        Select a.order, a.line,  sumshippedamt,
shippedamt/sumshippedamt * 100
                From orders a Join
                        (Select order, sum(shippedamt) sumshippedamt
                                From orders Group By order
                                Having sum(shippedamt) <> 0) b
                                On a.order = b.order

David Morris

>>> thatzenbeler@clinitech.net 11/27/01 11:34AM >>>
This message is in MIME format. Since your mail reader does not
understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]

I have been racking my brain on this for the past few days, and have
scanned
the net for help, but I still have not come up with a solution that I
can
grasp yet...

Does anybody know how I would create, an SQL program that would allow
me to
create a multi level cross-tab result set?

columns could be layered by  : Manager and then Department and then
Employee...
And the rows would be : Work Area and then Project
With a sum (of) hours at the intersection...

This seems to entail, reading and creating a cursor for distinct
columns,
and then process the distinct rows, for a given where clause...

But for the life of me, I can't figure out how to best code this...
Any
body out there have any ideas?

p.s., and here the clincher,  I need the columns to be dynamically read
and
created from the data...

Thanks, tim

If you can help, I can work with RPGSQL or JAVA or Stored
Procedures....


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.