Search⌘ K
AI Features

Fetching Unique Results

Explore how to use the DISTINCT keyword in SQL to extract unique values from query results. Understand how DISTINCT works with single and multiple fields to filter duplicates, and practice generating lists with unique entries, such as unique salespersons, to improve your data retrieval skills.

The DISTINCT keyword

Let’s write a query to retrieve ProductCategories . Run the following query to show results:

MySQL
SELECT ProductCategory FROM SalesData

It extracts the ProductCategory names from all records. Notably, the result set displays ...