From the course: Oracle Database 19c: Basic SQL
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
GROUP BY clause
From the course: Oracle Database 19c: Basic SQL
GROUP BY clause
- [Instructor] Many of your queries will have or require a group by clause. I'll show you what the group by does, where you need to use it, and how to use it. I'll also give you some caveats as well as a couple of tips about group by that aren't obvious. Using the group by clause in a select statement is synonymous with the grouping functions. You can't use a group by clause without at least one grouping function in the select clause. Group functions operate across multiple rows, not just one row, and return just one column result per group. How you group the rows is defined in the group by clause. There are cases where you don't have a group by clause, it's implied. Here are some of the most common group functions many of which you'll use every day. The average function calculates the numeric average, count returns the number of rows per group, min and max return the minimum and maximum results respectively. The standard deviation and variance are familiar to anyone who has to do any…