From the course: SQL for Data Analysis

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Finding duplicate rows

Finding duplicate rows - SQL Tutorial

From the course: SQL for Data Analysis

Finding duplicate rows

- [Instructor] Let's look at some ways to use SQL to identify duplicate values in our data, as well as how to prepare a summary that will give us even more insight. Now let's add two new clauses. They are the GROUP BY and HAVING clauses. The GROUP BY clause allows us to introduce aggregation to our SQL query. By using GROUP BY, we can group together rows that have the same values and summarize those groups with aggregate functions, as we have seen in some previous examples. Aggregate functions include COUNT, SUM, AVG, MIN, and MAX functions. We will look at some of those functions a little later in this course. For now, let's focus on the COUNT function that will help us identify the duplicate records. Let's start by going to duplicate 1 dot SQL. All of fields in the select statement must also be in the group by. Now, here's an example of a summary. I want to count the number of orders for each customer.…

Contents