Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Tags
#has-images
Question

E) Oracle GROUP BY with ROLLUP example

The following statement computes the sales amount and groups them by customer_id, status, and (customer_id, status):

Answer

1 2 3 4 5 6 7 8 9 10 11 12 13SELECT customer_id, status, SUM ( quantity * unit_price ) sales FROM orders INNER JOIN order_items USING (order_id) GROUP BY ROLLUP( customer_id, status );


Tags
#has-images
Question

E) Oracle GROUP BY with ROLLUP example

The following statement computes the sales amount and groups them by customer_id, status, and (customer_id, status):

Answer
?

Tags
#has-images
Question

E) Oracle GROUP BY with ROLLUP example

The following statement computes the sales amount and groups them by customer_id, status, and (customer_id, status):

Answer

1 2 3 4 5 6 7 8 9 10 11 12 13SELECT customer_id, status, SUM ( quantity * unit_price ) sales FROM orders INNER JOIN order_items USING (order_id) GROUP BY ROLLUP( customer_id, status );

If you want to change selection, open document below and click on "Move attachment"

The Ultimate Guide to Oracle GROUP BY with Examples
USING(customer_id) WHERE status = 'Shipped' GROUP BY name ORDER BY name; Here is the output: Note that the Oracle always evaluates the condition in the WHERE clause before the GROUP BY clause. <span>E) Oracle GROUP BY with ROLLUP example The following statement computes the sales amount and groups them by customer_id, status, and (customer_id, status): 1 2 3 4 5 6 7 8 9 10 11 12 13 SELECT customer_id, status, SUM( quantity * unit_price ) sales FROM orders INNER JOIN order_items USING(order_id) GROUP BY ROLLUP( customer_id, status ); In this tutorial, you have learned how to use the Oracle GROUP BY clause to group rows into groups. Was this tutorial helpful? yesno Previous Tutorial: Oracle Self Join Next Tutorial: O

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.