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

In this example, we grouped the orders by customers and used the COUNT() function to return the number of orders per group.

To get more meaningful data, you can join the orders table with the customers table as follows:

Answer

SELECT name, COUNT ( order_id ) FROM orders INNER JOIN customers USING (customer_id) GROUP BY name ORDER BY name;

Here is the result:


Tags
#has-images
Question

In this example, we grouped the orders by customers and used the COUNT() function to return the number of orders per group.

To get more meaningful data, you can join the orders table with the customers table as follows:

Answer
?

Tags
#has-images
Question

In this example, we grouped the orders by customers and used the COUNT() function to return the number of orders per group.

To get more meaningful data, you can join the orders table with the customers table as follows:

Answer

SELECT name, COUNT ( order_id ) FROM orders INNER JOIN customers USING (customer_id) GROUP BY name ORDER BY name;

Here is the result:

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

The Ultimate Guide to Oracle GROUP BY with Examples
unction example The following statement returns the number of orders by customers: 1 2 3 4 5 6 7 8 9 SELECT customer_id, COUNT( order_id ) FROM orders GROUP BY customer_id ORDER BY customer_id; <span>In this example, we grouped the orders by customers and used the COUNT() function to return the number of orders per group. To get more meaningful data, you can join the orders table with the customers table as follows: 1 2 3 4 5 6 7 8 9 10 11 SELECT name, COUNT( order_id ) FROM orders INNER JOIN customers USING(customer_id) GROUP BY name ORDER BY name; Here is the result: C) Oracle GROUP BY with an expression example The following example groups the orders by year and returns the number of orders per year. 1 2 3 4 5 6 7 8 9 SELECT EXTRACT(YEAR FROM order

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.