Is it possible to "select distinct" while using a "with clause"?
Hi all,
TLDR:
It seems that the
If I remove the
Full details:
I have the following tables:
(The real use case has many more columns, but this is a minimally viable reproduction).
I'd like to execute a select query that utilize a "with" clause and then a "distinct on". It should look like this:
However, it seems that the
If I remove the
What am I missing here?
Thanks
TLDR:
It seems that the
selectDistinct function does not exist on the object I get after I do db.with(...). If I remove the
with then selectDistinct exists, but that breaks my query.Full details:
I have the following tables:
(The real use case has many more columns, but this is a minimally viable reproduction).
I'd like to execute a select query that utilize a "with" clause and then a "distinct on". It should look like this:
However, it seems that the
selectDistinct function does not exist on the object I get after I do db.with(...). If I remove the
with then selectDistinct exists, but that breaks my query.What am I missing here?
Thanks