Marc
Marc
Explore posts from servers
DTDrizzle Team
Created by Marc on 3/7/2024 in #help
Can I use "where" clause on joins ?
I've done it like that:
const data = await db
.select()
.from(model)
.leftJoin(task, eq(model.taskId, task.id))
.leftJoin(dataset, eq(task.datasetId, dataset.id))
.where(
and(eq(model.id, modelId), eq(dataset.userDatasetId, userDatasetId))
);
const data = await db
.select()
.from(model)
.leftJoin(task, eq(model.taskId, task.id))
.leftJoin(dataset, eq(task.datasetId, dataset.id))
.where(
and(eq(model.id, modelId), eq(dataset.userDatasetId, userDatasetId))
);
Seems to work 🙂
5 replies
DTDrizzle Team
Created by Marc on 3/7/2024 in #help
Can I use "where" clause on joins ?
Thanks !
5 replies