4 ms·
A good example might be a groupwise maximum. Those always tend to be a bit of a PITA in SQL if you're not writing them regularly. Be interesting to see what it
by davidw 4y ago
A good example might be a groupwise maximum. Those always tend to be a bit of a PITA in SQL if you're not writing them regularly. Be interesting to see what it transpiles to, as well.
- aerzen 4y agoIf you only want maximum of one column, the PRQL is quite simple: from my_table group column_a ( aggregate (max column_b) ) If you want the row with the maximum value it gets interesting: from my_table group column_a ( sort [-column_b] take 1 ) You can read more about group here: https://prql-lang.org/book/transforms/group.html https://prql-lang.org/book/transforms/group.html
- beaugunderson 4y agoOpened an issue as I couldn't get this to work against sqlite: https://github.com/prql/prql/issues/695 https://github.com/prql/prql/issues/695
- maximilianroos 4y agoThanks a lot for testing and opening an issue! This is now fixed and released [1]. Let us know if you still face any problems. (We need better tests against real DBs, which is very much on our roadmap) [1]: https://github.com/prql/prql/pull/698 https://github.com/prql/prql/pull/698
- beaugunderson 4y agoThank you for the amazingly quick fix!