Skip to main content

SELECT DISTINCT outputs a column's unique values

Here’s how to see all the different values in a column:

unique-column-values.sql
SELECT DISTINCT column1, column2, ...columnN 
FROM table_name;

I found that helpful today when I was trying to understand the significance of a value by comparing it to the other options.

Source: Distinct in SQL: A Comprehensive Guide

Related to #sql