Oracle
  Home arrow Oracle arrow Page 4 - Large Database Features In Oracle, con...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ORACLE

Large Database Features In Oracle, conclusion
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 5
    2005-12-15

    Table of Contents:
  • Large Database Features In Oracle, conclusion
  • RAC Architecture
  • Self-Managing Databases
  • cube
  • Analysis Functions
  • Windowing Functions
  • Project 9-2 Using Analytic SQL Functions and Models

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Dell PowerEdge Servers

    Large Database Features In Oracle, conclusion - cube
    (Page 4 of 7 )

    The cube extension takes rollup a step further by generating subtotals for each combination of the group by attributes, totals by attribute, and the grand total. The following is an example of the cube extension, using the same query we used for rollup:

    select c.cust_gender gender,
           b.channel_class channel_class,
           to_char(a.time_id, 'yyyy-mm') month,
           count(*) unit_count,
           sum(a.amount_sold) amount_sold
    from sales a, channels b, customers c
    where a.channel_id = b.channel_id
    and a.cust_id = c.cust_id
    and to_char(a.time_id, 'yyyy-mm') between '2001-01' and '2001-02'
    group by cube(c.cust_gender,
                  
    b.channel_class,
                   to_char(a.time_id, 'yyyy-mm'));

    GENDER

    CHANNEL_CLASS

    MONTH

    UNIT_COUNT

    AMOUNT_SOLD

    ----------

    ----------------------

    ---------

    ----------------

    -------------------

     

     

     

    39924

    4216833.67

     

     

    2001-01

    20739

    2113709.13

     

     

    2001-02

    19185

    2103124.54

     

    Direct

     

    20427

    2113199.92

     

    Direct

    2001-01

    11039

    1106147.18

     

    Direct

    2001-02

    9388

    1007052.74

     

    Others

     

    12603

    1278645.06

     

    Others

    2001-01

    6796

    657218.93

     

    Others

    2001-02

    5807

    621426.13

     

    Indirect

     

    6894

    824988.69

     

    Indirect

    2001-01

    2904

    350343.02

     

    Indirect

    2001-02

    3990

    474645.67

    F

     

     

    14274

    1552931.54

    F

     

    2001-01

    7540

    768012.01

    F

     

    2001-02

    6734

    784919.53

    F

    Direct

     

    7209

    752861.03

    F

    Direct

    2001-01

    4001

    387000.9

    F

    Direct

    2001-02

    3208

    365860.13

    F

    Others

     

    4542

    472249.42

    F

    Others

    2001-01

    2486

    242615.9

    F

    Others

    2001-02

    2056

    229633.52

    F

    Indirect

     

    2523

    327821.09

    F

    Indirect

    2001-01

    1053

    138395.21

    F

    Indirect

    2001-02

    1470

    189425.88

    M

     

     

    25650

    2663902.13

    M

     

    2001-01

    13199

    1345697.12

    M

     

    2001-02

    12451

    1318205.01

    M

    Direct

     

    13218

    1360338.89

    M

    Direct

    2001-01

    7038

    719146.28

    M

    Direct

    2001-02

    6180

    641192.61

    M

    Others

     

    8061

    806395.64

    M

    Others

    2001-01

    4310

    414603.03

    M

    Others

    2001-02

    3751

    391792.61

    M

    Indirect

     

    4371

    497167.6

    M

    Indirect

    2001-01

    1851

    211947.81

    M

    Indirect

    2001-02

    2520

    285219.79

    In the results, we can see that counts and sums of amount_sold are returned at the following levels:

    • By GENDER, CHANNEL_CLASS, and MONTH
    • Subtotals by MONTH within CHANNEL_CLASS
    • Subtotals by MONTH within GENDER
    • Subtotals by CHANNEL_CLASS within GENDER
    • Subtotals by MONTH
    • Subtotals by CHANNEL_CLASS
    • Subtotals by GENDER
    • Grand total

       

    More Oracle Articles
    More By McGraw-Hill/Osborne


       · This article is an excerpt from the book "Oracle Database 10g A Beginner's Guide,"...
     

    Buy this book now. This article is excerpted from chapter nine of the book Oracle Database 10g A Beginner's Guide, written by Ian Abramson et al (Mcgraw-Hill/Osborne, 2004; ISBN: 0072230789). Check it out at your favorite bookstore. Buy this book now.

       

    ORACLE ARTICLES

    - Tuning PL/SQL Code
    - Debugging PL/SQL Code
    - Testing PL/SQL Code
    - Working With PL/SQL Code
    - Conditional Compilation for Oracle Database ...
    - Compile-Time Warnings for Oracle DB 10g
    - Compiling PL/SQL Code for an Oracle Database
    - Troubleshooting PL/SQL Code
    - Managing PL/SQL Code
    - Data Manipulation and More for HTML DB Appli...
    - Oracle Database Fundamentals
    - Adding Processes to HTML DB Applications
    - Adding Computations, Processes, and Validati...
    - Sub-templates and More with Oracle HTML DB
    - Focusing on Templates in Oracle HTML DB




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway