Replies: 2 comments
-
I was also looking for that, kinda of annoying that it can't be done |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think you can use sea-query to achieve this |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In #55 you decided not to support subqueries in joins until someone has a good usecase. I think I might be able to provide that now; with the famous
greatest-n-per-group
problem:Following example:
I have a list of contracts. Every contract is between me and a customer. The customer's address (where the invoice should be sent, e.g.) changes over time. Each
CustomerAddress
has a date specifying the starting point (as adate
) from which on it is valid.A typical query in this setup is to retrieve a list of active contracts, joined with the customers and their currently active address.
For sqlite, this would look something like this:
As soon as #2179 lands, this would make sea-orm so much more powerful, because that would allow:
Beta Was this translation helpful? Give feedback.
All reactions