Open
Description
What happened?
I wrote a query that should select all companies with more than one addreses, and list all addresses except the most recent one.
However, I get a compiler panic on the playground.
PRQL input
from c = companies
join ca = companies_addresses(c.tax_code == ca.company)
group c.tax_code (
join a = addresses(a.id == ca.address)
sort {-ca.created_at}
take 2..
)
sort tax_code
SQL output
A compiler bug was encountered. Please copy/paste the PRQL query into a new report at:
https://github.com/PRQL/prql/issues/new?template=bug_report.yaml
Expected SQL output
(I have no idea how to write this query in SQL)
MVCE confirmation
- Minimal example
- New issue
Anything else?
It may be related to #3870