ORDER BY in agg function.
Hi, I would like to represent something like
in kysely. How would I go about doing this?
Thanks in advance.
2 Replies
Hey 👋
We don't have built-in support for
json_agg
, eb.table
(unreleased probably) or order by
of a table ref. So this is the best approach right now imho.
Can you provide docs link of this SQL syntax?Thank you, I am currently using
sql
but I did not realise you could pass a type argument!
I found this in the postgres docs: https://www.postgresql.org/docs/current/sql-expressions.html#SYNTAX-AGGREGATESPostgreSQL Documentation
4.2. Value Expressions
4.2. Value Expressions # 4.2.1. Column References 4.2.2. Positional Parameters 4.2.3. Subscripts 4.2.4. Field Selection 4.2.5. Operator Invocations 4.2.6. Function Calls …