Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

select's MODEL clause to add columns on the resultset, not just new rows?

Ruslan D.Jul 26 2016 — edited Jul 27 2016

PIVOT can only pivot one value into its one column.

Also PIVOT is not helpful if for examle we want to pivot and (group by) intersecting ranges of values.

So we're planning to use MODEL clause to overcome this limits.

We have to pivot into columns:

- sum(), count() of data over separate quarters for last 2 years and present each quarter's result into its own set of column;

- sum(), count() of data over separate years for last 2 years and present each years's result into its own set of column;

- sum(), count() of data over separate months for last 3  months and present each month's result into its own set of column.

The list of quarters / years / months in the bucketing is fixed and can be hard-coded in the MODEL clause (i.e. it'll be always to look back 2 years).

I have a working prototype doing above using three separate pivots, but it is very inefficient because each pivot has to pass

our huge dataset again.

We expect MODEL might require just one pass over the dataset.

Questions:

- Is it possible for MODEL clause to create new columns (ie. we group by month and product category in a subquery, but MODEL should add columns for the above quarter/year/month buckets)?

- Can't think of a best way to define DIMENSION BY and MEASURES so we could create new columns..

Any ideas are highly appreciated.

Comments

StanislavL
Use your action event getSource() method/
801416
I know that I can use getSource() method to identify action event... but how can I identify the main panel it belongs to?
kleopatra-JavaNet
what's wrong with getSource().getParent() ? (apart from the missing type cast, obviously ;-)

Cheers
Jeanette
darrylburke
user1202074 wrote:
I have ‘n’ numbers of JPanel. And each panel contains certain number of sub-panels. Those sub-panels have actionlisteners.
:
Note that ‘n’ is unknown and main panels will be created dynamically. Now, if I attach actionListener with all of those sub_panels,
<tt>JPanel</tt>s can't have <tt>ActionListeners</tt>. What class of GUI component are you really talking about?

db
darrylburke
Cross posted
http://www.java-forums.org/awt-swing/36424-swing-how-indentify-certain-actions-sub-panels.html

Any more?

db
801416
when I said sub-panels, I meant Jtextfield, Jcombobox.
1 - 6
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 24 2016
Added on Jul 26 2016
10 comments
334 views