PL/SQL Group By

The Group By clause is used when an aggregate function (count, max, min, sum, avg) exists in the pl/sql query.

SQL Query

SELECT c.course_id,, c.description, o.order_id, c.price
FROM course c, orders o
WHERE o.course_id = c.course_id;


1SQL 1SQL course for beginners2210
1SQL 1SQL course for beginners110
4PHPPHP course375
5CSSLearn CSS2120
5CSSLearn CSS220

Group By example

SELECT c.course_id,, c.description, c.price, 
		SUM(c.price) AS amount, COUNT(c.course_id) AS quantity
FROM course c, orders o
WHERE o.course_id = c.course_id
GROUP BY c.course_id,, c.description, c.price;


1SQL 1SQL course for beginners10202
4PHPPHP course75751
5CSSLearn CSS20402