This commit is contained in:
Igor Nikonov 2023-03-15 12:44:22 +00:00
parent c45c04a1bb
commit cc3c8a4e30
2 changed files with 17 additions and 0 deletions

View File

@ -464,3 +464,16 @@ Expression ((Projection + (Before ORDER BY + (Projection + Before ORDER BY))))
1
0
-- DISTINCT COUNT() with GROUP BY => do _not_ remove DISTINCT
-- query
select distinct count() from numbers(10) group by number
-- explain
Expression (Projection)
Distinct
Distinct (Preliminary DISTINCT)
Expression (Before ORDER BY)
Aggregating
Expression (Before GROUP BY)
ReadFromStorage (SystemNumbers)
-- execute
1

View File

@ -256,3 +256,7 @@ FROM
GROUP BY a WITH TOTALS
)"
run_query "$query"
echo "-- DISTINCT COUNT() with GROUP BY => do _not_ remove DISTINCT"
query="select distinct count() from numbers(10) group by number"
run_query "$query"