Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Retrieving Distinct Rows | Retrieving Data
TEST SQL COURSE E2E
course content

Course Content

TEST SQL COURSE E2E

TEST SQL COURSE E2E

1. Sorting Retrieved Data
2. Retrieving Data
3. Failing init script
4. Long execution init script

book
Retrieving Distinct Rows

Note that the SELECT statement returns all rows in a given column. Nevertheless, what if we don't need all the values ​​from a column (because they can be duplicated), and we only need unique values? For such cases, it is convenient to use the keyword DISTINCT. Moreover, this keyword is used immediately before the column names. Let's look at an example.

1
SELECT DISTINCT region FROM country;
copy
Task
test

Swipe to show code editor

You have to retrieve distinct (unique) continent values.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 3
toggle bottom row

book
Retrieving Distinct Rows

Note that the SELECT statement returns all rows in a given column. Nevertheless, what if we don't need all the values ​​from a column (because they can be duplicated), and we only need unique values? For such cases, it is convenient to use the keyword DISTINCT. Moreover, this keyword is used immediately before the column names. Let's look at an example.

1
SELECT DISTINCT region FROM country;
copy
Task
test

Swipe to show code editor

You have to retrieve distinct (unique) continent values.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 3
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt