We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
let json_agg = func arr -> s"json_agg({arr})" from invoices sort total aggregate (json_agg f"{month}: {total}")
(intention: I want a single row that is a json array, which contains "month: total" entries, sorted by total)
I think this PRQL should produce the following SQL:
SELECT json_agg(month || ': ' || total ORDER BY total) FROM invoices
The important bit is that json_agg has it's column ORDERed BY total.
json_agg
This is because from invoices | sort total produces a relation, ordered by total, so this ordering should be accounted by the aggregation function.
from invoices | sort total
The text was updated successfully, but these errors were encountered:
No branches or pull requests
(intention: I want a single row that is a json array, which contains "month: total" entries, sorted by total)
I think this PRQL should produce the following SQL:
The important bit is that
json_agg
has it's column ORDERed BY total.This is because
from invoices | sort total
produces a relation, ordered by total, so this ordering should be accounted by the aggregation function.The text was updated successfully, but these errors were encountered: