Struggling with simple subquery statement in Drizzle
Hi friends, I have a complex query like so that I've made into a subquery:
and I want to do some additional filtering on the query and fetch the count as well like so:
However I am getting the following error:
Error: Your "lead->id" field references a column "leads"."id", but the table "leads" is not part of the query! Did you forget to join it?
any ideas why this doesn't work? Docs + GPT have been no help.4 Replies
If you put this in drizzle.run it's easier to take a look and make quick changes
Hey @Angelelz , here's a minimal example:
https://drizzle.run/qdym3nmhrqi30hoy9yndsors
Drizzle Run
New starter 01 playground - Drizzle Run
I don't see any issues with this https://drizzle.run/vihy2j6udcupo6u525z55u22
Oh ur right I will copy over my example in full