Summary
Low-priority ergonomics request: support COUNT(DISTINCT col) as an aggregate.
Motivation
Today, getting a distinct-value count takes a query plus an external line count:
xql csv apps.csv --exec "SELECT DISTINCT application_name WHERE application_name IS NOT NULL" --mode=csv --no-output-header | grep -c .
COUNT(DISTINCT col) would collapse that to one self-contained query:
xql csv apps.csv --exec "SELECT COUNT(DISTINCT application_name) WHERE application_name IS NOT NULL"
It would also sidestep an easy off-by-one: an unfiltered SELECT DISTINCT counts the NULL/blank group as one distinct value, so the piped count reads one higher than the number of real values unless you remember to add IS NOT NULL.
Priority / scope
Low priority, pure convenience — the SELECT DISTINCT + count workaround works fine. Just COUNT(DISTINCT col); no need for multi-column COUNT(DISTINCT a, b) unless it's trivial to include.
Version / environment
- xql 1.5.0
- Linux (x86_64), bash
Summary
Low-priority ergonomics request: support
COUNT(DISTINCT col)as an aggregate.Motivation
Today, getting a distinct-value count takes a query plus an external line count:
COUNT(DISTINCT col)would collapse that to one self-contained query:It would also sidestep an easy off-by-one: an unfiltered
SELECT DISTINCTcounts the NULL/blank group as one distinct value, so the piped count reads one higher than the number of real values unless you remember to addIS NOT NULL.Priority / scope
Low priority, pure convenience — the
SELECT DISTINCT+ count workaround works fine. JustCOUNT(DISTINCT col); no need for multi-columnCOUNT(DISTINCT a, b)unless it's trivial to include.Version / environment