Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
SQL Server 119
#SQLServer 88
Oracle 70
#SQL SERVER 35
BRH 31
SQL Server 2012 29
denali 23
#TSQL 19
TSQL 19
C# 15

Archive · View All
October 2011 31
November 2011 30
September 2011 30
August 2011 18
December 2011 15
July 2011 13
June 2011 8
May 2012 4
April 2012 3
January 2010 3

Day 32: Cube function of Oracle

Oct 15 2011 8:08AM by Niladri Biswas   

Let Us Learn Oracle - Part 32 of N [ Cube function of Oracle ]

Purpose: It gives a cross tabulated summary of detail rows. It calculates subtotals for all possible combinations of group parameters.It also calculates the grand total.

Select DeptName,BelongsTo, Count(*) "Departmentwise Employee", Avg(Salary) "Deptwise Avg Sal"
From tblEmployee e
Join tblDept d 
Using(DeptId)
Group By Cube(DeptName,BelongsTo)
Order by Null desc;

/* Result */
DEPTNAME                                           BELONGSTO  Departmentwise Employee                Deptwise Avg Sal                       
Accounts                                           Singapore  6                                      3711.66666666667                       
Accounts                                                      6                                      3711.66666666667                       
Finance                                            Australia  4                                      5525                                   
Finance                                                       4                                      5525                                   
IT                                                 India      5                                      8202                                   
IT                                                            5                                      8202                                   
Sales                                              HongKong   1                                      650                                    
Sales                                                         1                                      650                                    
                                                   Australia  4                                      5525                                   
                                                   HongKong   1                                      650                                    
                                                   India      5                                      8202                                   
                                                   Singapore  6                                      3711.66666666667                       
                                                              16                                     5376.875                               
                   

We obtain the Countrywise summary too by using this function.

The same function is also available in Sql Server

Thanks for reading

Tags: #SQLServer, SQL Server, Oracle,


Niladri Biswas
7 · 21% · 6710
1
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

"Day 32: Cube function of Oracle" rated 5 out of 5 by 1 readers
Day 32: Cube function of Oracle , 5.0 out of 5 based on 1 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]