Read this next to the plain SELECT duplicate page:
Project the category column.
Compare each projected row with the rows already kept.
Keep the first copy of each category value and skip later equal copies.
The tiny table is pinned so the dedup step is auditable. DISTINCT changes row count; it does not estimate, sample, or choose a "best" row.
SELECT DISTINCT is the explicit dedup boundary for projected rows.
highlighted = computed this step
Input table
Use the same category table with a repeated category.
Order categories
Select query
DISTINCT projects the category column and collapses equal output rows.