Thread
#exposed
    galex

    galex

    3 years ago
    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?
    tapac

    tapac

    3 years ago
    Could you express it with a plain sql?
    galex

    galex

    3 years ago
    Yes, something like “Select count(*) as countStuff from TableB b where b.id = a.id” inside another query
    tapac

    tapac

    3 years ago
    TableA.innerJoin(TableB, { TableA.id }, { TableB.id }).
       slice(TableA.id.count()).
       selectAll()
    ?
    galex

    galex

    3 years ago
    I will try that, thanks