dcmoura / spyql

Query data on the command line with SQL-like SELECTs powered by Python expressions
https://spyql.readthedocs.io
MIT License
918 stars 25 forks source link

[FR] COUNT(DISTINCT col1) ... GROUP BY #88

Closed Minyus closed 1 year ago

Minyus commented 1 year ago

Thank you for the great tool!

I'd like to request feature which works like COUNT(DISTINCT col1) ... GROUP BY of SQL. I tried count_agg(distinct col1), but got syntax error.

dcmoura commented 1 year ago

Hi, thank you :-)

The syntax is a little different in SPyQL. Please try:


SELECT count_distinct_agg(col1) ...

You can check the reference for more aggregation functions: https://spyql.readthedocs.io/en/latest/reference.html#module-spyql.agg

Please let me know if you were able to do what you needed. Thanks!

Minyus commented 1 year ago

Ok, I'll try. Thank you!

Minyus commented 1 year ago

Worked like a charm! Thank you!