mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-01 23:44:19 +01:00
Add regression test for sort order with aggregate term in orderby with groupby
This commit is contained in:
@@ -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}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user