Query builder - nested select


#1

I’m trying to convert a native SQL query and wondered if anybody has an example of using an inner select statement? My original statement part reads as follows and I’m not sure of the syntax to create a nested select statement

    SELECT
        PickItems.id,
        PickItems.storeCode AS storeCode,
        PickItems.storeName,
        (SELECT
            "COUNT(PIALL.id) 
            "FROM 
            "PickItems AS PIALL 
           ...

Many thanks


#2

Query builder uses Knex.js, check the docs for that, they have examples for that I think.