How to describe where statement for null children? #1685
Unanswered
perevezencev
asked this question in
Q&A
Replies: 1 comment 11 replies
-
Children is not a column on the actual table. You are trying to find a category that doesn't have any descendants, meaning, a category whose drizzle.query.categories.findMany({
where: notInArray(categories.id, db.select({ parentId: categories.parentId }).from(categories))
}) It's basically a subquery. |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone. I have this code:
How to describe
where
statement, for get all category wherechildren
is empty?Beta Was this translation helpful? Give feedback.
All reactions