Jaden
Jaden
DTDrizzle Team
Created by Jaden on 9/13/2024 in #help
Select All from Sub-query
I thought there might be a function like .all() on the sub-query that would let me do this, but I can't seem to find an easy solution like that.
5 replies
DTDrizzle Team
Created by Jaden on 9/13/2024 in #help
Select All from Sub-query
@Mario564 My bad I didn't explain correctly what I'm trying to do. The problem I have with that solution is I want to add other columns to the select but get all the columns from the sub-query as well. For instance:
const subQuery = db().select({ ... }).from(...).as("subquery");

const query = db()
.select({
a: ...,
b: ...,
...subQuery
})
.from(subQuery);
const subQuery = db().select({ ... }).from(...).as("subquery");

const query = db()
.select({
a: ...,
b: ...,
...subQuery
})
.from(subQuery);
5 replies