Using `count` in CTE has type `never`
I got the following tables:
users
: id
, ...
followers
: followingId
, followerId
I'm trying to write a with
common table expression to reuse in other queries:
The problem is that now, if I try to use the results of that CTE, sq.following
and sq.followers
are not valid columns:
1 Reply
Fixed, I had to use
countDistinct(following.followingId).as('following')
etc.