From the course: Oracle Database 19c: Basic SQL

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using DISTINCT

Using DISTINCT

From the course: Oracle Database 19c: Basic SQL

Start my 1-month free trial

Using DISTINCT

- [Instructor] The tables may have repeated values in a column, but you don't want to see them all. I'll show you how to you distinct to only see one or a few of them. Here's a syntax diagram of the entire select statement. There are several places you can use the distinct keyword. You can use it in the main select clause. That's the most common. If you don't save distinct, then all is the default. Notice that you can also use unique instead of distinct. They perform the exact same function. The second place you will typically use distinct is within a group function. And performed separately from a distinct at the select clause level. Finally, you'll see some group functions with distinct in the name. I'll show you a couple of those later in this lesson. But what does distinct do? It acts somewhat like a filter. For all columns in the select list, adding the distinct key word returns only one row for each combination of the columns in the select clause. The number of columns you list…

Contents