how to make order work with selectDistinctOn in pg?
When I add order by to my query it gives error that "initial order by prop should be the same with distinct on prop", but i dont want first orderby parameter to be tasks.id. i want it to be as on the comment. Could you please let me know how i can achive it?
( And when i try to make the query with distincton a subquery, then use it in new one with orderby, i am getting this error: "error": "You tried to reference "assignees" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.")
0 Replies