SQLDISTINCTtutorial

What is DISTINCT in SQL? Unique values for beginners

DISTINCT means "remove duplicates". Plain words: unique values of a column or combination of columns, the difference from GROUP BY, NULL handling, and the PostgreSQL-specific DISTINCT ON for "one row per group". With before/after tables and common pitfalls.

1 min readSQL · DISTINCT · tutorial

DISTINCT is the command for "don't return duplicate rows". The simplest way to get unique values of a column or combination of columns.

This article is currently in Russian. The full English translation is on the way.

Practice on real tasks

Solve tasks in the SQL trainer with instant grading and hints.

Open trainer