Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Unique values from column | Selecting
SQL Basics

book
Unique values from column

In real life, you may work with big tables containing thousands of rows and lots of columns. For example, you may have a database with all the users who have visited your site, and you want to know all the countries that attended your site.

In SQL, to extract unique values from the column use the DISTINCT statement. For example, to extract unique countries from the table visitors use:

SELECT DISTINCT(country)
FROM visitors
12
SELECT DISTINCT(country) FROM visitors
copy
Tâche

Swipe to start coding

From the audi_cars table extract all the unique models of cars.

Solution

SELECT DISTINCT(model)
FROM audi_cars

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 4

Query ResultQuery Result
No query executed yet...

Demandez à l'IA

expand
ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

some-alt