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

Kursinnehåll

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
Uppgift

Swipe to start coding

You have to retrieve distinct (unique) continent values.

Lösning

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 2. Kapitel 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
Uppgift

Swipe to start coding

You have to retrieve distinct (unique) continent values.

Lösning

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 2. Kapitel 3
Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Vi beklagar att något gick fel. Vad hände?
some-alt