How do I query table B to count how many rows have...
# exposed
g
How do I query table B to count how many rows have my id from Table A? Basically a calculated field based on another select?
t
Could you express it with a plain sql?
g
Yes, something like “Select count(*) as countStuff from TableB b where b.id = a.id” inside another query
t
Copy code
TableA.innerJoin(TableB, { TableA.id }, { TableB.id }).
   slice(TableA.id.count()).
   selectAll()
?
g
I will try that, thanks