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:
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.