Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
SQL Distinct | Database & Introduction to Syntax
SQL Tutorial for Beginners
course content

Contenido del Curso

SQL Tutorial for Beginners

SQL Tutorial for Beginners

1. Database & Introduction to Syntax
2. SQL Aggregate Functions
3. Filtering Statements

bookSQL Distinct

Distinct is a keyword used with SELECT to return only unique values. Usually, you want to get all unique values, but there are duplicate values stored in the tables.

Check the difference: in our table, there are 18 records at all, and each record has a singer. You'll retrieve the 18 singers with the next query:

12
SELECT singer FROM songs
copy

But some singers, for example, AC/DC, occur multiple times. To retrieve the unique singers, use the DISTINCT keyword before the singer column:

12
SELECT DISTINCT singer FROM songs
copy

Now there are no repeated values, so you can see that the total number of unique singers is 10.

Tarea

Find all unique title values in songs.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 4
toggle bottom row

bookSQL Distinct

Distinct is a keyword used with SELECT to return only unique values. Usually, you want to get all unique values, but there are duplicate values stored in the tables.

Check the difference: in our table, there are 18 records at all, and each record has a singer. You'll retrieve the 18 singers with the next query:

12
SELECT singer FROM songs
copy

But some singers, for example, AC/DC, occur multiple times. To retrieve the unique singers, use the DISTINCT keyword before the singer column:

12
SELECT DISTINCT singer FROM songs
copy

Now there are no repeated values, so you can see that the total number of unique singers is 10.

Tarea

Find all unique title values in songs.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 4
toggle bottom row

bookSQL Distinct

Distinct is a keyword used with SELECT to return only unique values. Usually, you want to get all unique values, but there are duplicate values stored in the tables.

Check the difference: in our table, there are 18 records at all, and each record has a singer. You'll retrieve the 18 singers with the next query:

12
SELECT singer FROM songs
copy

But some singers, for example, AC/DC, occur multiple times. To retrieve the unique singers, use the DISTINCT keyword before the singer column:

12
SELECT DISTINCT singer FROM songs
copy

Now there are no repeated values, so you can see that the total number of unique singers is 10.

Tarea

Find all unique title values in songs.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Distinct is a keyword used with SELECT to return only unique values. Usually, you want to get all unique values, but there are duplicate values stored in the tables.

Check the difference: in our table, there are 18 records at all, and each record has a singer. You'll retrieve the 18 singers with the next query:

12
SELECT singer FROM songs
copy

But some singers, for example, AC/DC, occur multiple times. To retrieve the unique singers, use the DISTINCT keyword before the singer column:

12
SELECT DISTINCT singer FROM songs
copy

Now there are no repeated values, so you can see that the total number of unique singers is 10.

Tarea

Find all unique title values in songs.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
Sección 1. Capítulo 4
Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
some-alt