You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's been a while and I thinking I'm losing my GRDB IQ.
So here goes:
Using Joined Table Column in order clause
I have a table A with a hasMany relationship to table B.
I want to perform a query where the column name in the joined table B is the first item in the order statement.
Is this the best way? I would rather not specify the column name of TableB using this string construction.
Let me know what I have missed.
Thanks
The text was updated successfully, but these errors were encountered:
martindufort
changed the title
Using a Joined Table column has the first column in the .order() function
Using a Joined Table column as the first column in the .order() function
Sep 18, 2024
Hey Groue, ca va?
It's been a while and I thinking I'm losing my GRDB IQ.
So here goes:
Using Joined Table Column in order clause
I have a table A with a hasMany relationship to table B.
I want to perform a query where the column name in the joined table B is the first item in the order statement.
I've tried this:
This puts the
TableB.name
column as the last item in the order by clause.Then I read the documentation and tried asking you know who.
Finally I was able to resolve this by declaring the TableB column explicitly
Here's the sample code
Question?
Is this the best way? I would rather not specify the column name of TableB using this string construction.
Let me know what I have missed.
Thanks
The text was updated successfully, but these errors were encountered: