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

bookRetrieving 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
Compito

Swipe to start coding

You have to retrieve distinct (unique) continent values.

Soluzione

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 2. Capitolo 3
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

Suggested prompts:

Riassuma questo capitolo

Explain code

Explain why doesn't solve task

close

Awesome!

Completion rate improved to 16.67

bookRetrieving Distinct Rows

Scorri per mostrare il menu

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
Compito

Swipe to start coding

You have to retrieve distinct (unique) continent values.

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

close

Awesome!

Completion rate improved to 16.67
Sezione 2. Capitolo 3
single

single

some-alt