Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Syntax for simple (?) pivot with MODEL clause

Re: Syntax for simple (?) pivot with MODEL clause

From: <dba_222_at_yahoo.com>
Date: Mon, 13 Aug 2007 14:22:19 -0700
Message-ID: <1187040139.407974.83670@r34g2000hsd.googlegroups.com>


OK, I'm back. No emergencies today.

Our data changes on a daily, weekly and monthly basis. So, hardcoding values is not an option.

CASE and DECODE would require hardcoding; that you know exactly what the values will be. If new rows with new and different values were entered into the field, you would have to re hardcode the query.

I had looked at PSOUG actually.
http://www.psoug.org/reference/model_clause.html

Where at least some of the examples were the same as from: http://download.oracle.com/docs/cd/B19306_01/server.102/b14223/sqlmodel.htm

Both examples required hardcoding the value:

RULES (sales['Bounce', 2005] = 100 + MAX(sales)['Bounce', year BETWEEN 1998 AND 2002])

ie. 'BOUNCE', refers to product = 'BOUNCE'

With 10G's new features, is it possible to do this kind of thing, dynamically getting a different number of columns back? In particular with the MODEL clause?

Perhaps a new feature in Oracle 11?

What is the secret please? Received on Mon Aug 13 2007 - 16:22:19 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US