Loading…
Same data entered differently:
SELECT UPPER('hello') -- returns 'HELLO'
SELECT LOWER('HELLO') -- returns 'hello'
You can GROUP BY a transformed value to merge variations:
SELECT LOWER(TRIM(source)) as standardized_source,
COUNT(*) as lead_count
FROM leads
GROUP BY LOWER(TRIM(source)); -- "SALES", "sales", "Sales" all become "sales"
Standardize the source column for analysis:
Group by the standardized value. Order by count descending.
Run your query to see results