Hello,
I am using Presto with Helical Insight 4.0. When I have distinct function applied on the columns, order by or sorting does not work and generates incorrect SQL. Below is a snapshot of the output and also the SQL query that is generated. Please help correct this issue.
The SQL produced is as below:
**select**
"Distinct_Visitors"."browser" **as** "Browsers",
"Distinct_Visitors"."distinct_visitors" **as** "Distinct Visitors" ,dense_rank() over( **order** **by** "Distinct_Visitors"."browser" **asc** ) **as** rownum
**from** (
**select**
count( **distinct** visitorid) **as** distinct_visitors,
browser **from** hive.matomo_demo_prod.dive_zone_dataset **group** **by** browser
) "Distinct_Visitors"
**order** **by**
"Browsers",
"Distinct Visitors"
**asc**
Thank You