beancount / beanquery

A customizable light-weight SQL query tool that works on tabular data, including Beancount.
GNU General Public License v2.0
20 stars 12 forks source link

bean-query: ORDER BY does not accept per-keyword sort direction #63

Closed blais closed 2 years ago

blais commented 9 years ago

Original report by Harpreet Sangha (Bitbucket: eliptus, GitHub: eliptus).


I noticed that when using ORDER BY with bean-query sort direction cannot be specified per keyword.

For example: beancount> SELECT year, account, COST(SUM(position)) AS total WHERE account ~ "^Expenses:" GROUP BY 1, 2 ORDER BY 1 ASC, 2 DESC ERROR: Syntax error near ',' (at 108) SELECT year, account, COST(SUM(position)) AS total WHERE account ~ "^Expenses:" GROUP BY 1, 2 ORDER BY 1 ASC, 2 DESC

dnicolodi commented 2 years ago

Implemented in #28.