Use SELECT DISTINCT to enumerate the canonical set of values in a column. Critical first step before any filter or rollup — you need to know what's in the column before you can write a WHERE clause against it.
Quick sanity-check before I write tomorrow's revenue report. Give me every distinct `financial_status` value that appears in `ecom_orders`. Just the one column. Raw values — don't normalize, I want to see exactly how Shopify stores them. Mira and the CFO disagree on which statuses count as 'revenue' and I need the canonical list before that meeting.
| Column | Type | Key |
|---|---|---|
| order_id | INT | PK |
| customer_id | INT | FK → ecom_customers |
| order_number | TEXT | |
| financial_status | TEXT | |
| fulfillment_status | TEXT | |
| total_price | REAL | |
| subtotal | REAL | |
| tax | REAL | |
| shipping | REAL | |
| discount_total | REAL | |
| channel | TEXT | |
| created_date | TEXT | |
| processed_date | TEXT |
Each hint you reveal reduces the XP you can earn. Try the query first.
Statuses repeat across many order rows — you want the unique list, not a count. The SQL keyword for that is `DISTINCT`.
`SELECT DISTINCT financial_status FROM ecom_orders` returns one row per unique value, no GROUP BY needed.
You should see seven statuses: paid, refunded, partially_refunded, voided, pending, partially_paid, authorized. That's the Shopify canon.