Query from table with where clause NOT IN another sub query?

For ex: select * from TableA where email not in (select email from TableB); ?
2 Replies
rushil1o1
rushil1o1OP2y ago
Here's what I'm trying:
const results = await db
.select({
...getTableColumns(employeeTable),
})
.from(employeeTable)
// .leftJoin(usersQuery, eq(employeeTable.workEmail, usersQuery.email)
.where(notInArray(employeeTable.workEmail, usersQuery))
.limit(limit);
const results = await db
.select({
...getTableColumns(employeeTable),
})
.from(employeeTable)
// .leftJoin(usersQuery, eq(employeeTable.workEmail, usersQuery.email)
.where(notInArray(employeeTable.workEmail, usersQuery))
.limit(limit);
Want results from more Discord servers?
Add your server