Add regression test for sort order with aggregate term in orderby with groupby

This commit is contained in:
PThorpe92
2025-09-23 23:08:31 -04:00
parent 58625b1c6d
commit 4cc02dbed1

View File

@@ -326,3 +326,23 @@ sneakers|sneakers|sneakers
boots|boots|boots
coat|coat|coat
accessories|accessories|accessories}
# make sure we return the group by key sorted DESC when the order by has only an aggregate term
do_execsql_test proper-sort-order {
SELECT u.first_name, COUNT(*) AS c
FROM users u
JOIN products p ON p.id = u.id
GROUP BY u.first_name
ORDER BY c DESC;
} {Travis|1
Tommy|1
Rachel|1
Nicholas|1
Matthew|1
Jennifer|1
Jamie|1
Edward|1
Daniel|1
Cindy|1
Aimee|1}