SQL Server cube operator interview questions
SQL Server Cube operator - Nov 20, 2008 at 18:00 PM
by Rajmeet Ghai
Explain
how to use Cube operator to summarize data.
Answer
A Cube operator summarizes data of group by. It helps in determining subtotals
and grand totals.
Example:
This will display a summary of employees with same first name.
Select
first_name, last_name, AVG(salary) FROM employee GROUP BY first_name WITH CUBE
<<Previous
Next>>
|