How to return rows if date is null #1035
Answered
by
simolus3
HasanAlqaisi
asked this question in
Q&A
-
|
Hi, I want to return rows when the date field is null, i couldn't make this work and I don't know if i'm doing it in the right way.. |
Beta Was this translation helpful? Give feedback.
Answered by
simolus3
Feb 6, 2021
Replies: 1 comment
-
|
return (select(taskTable)..where((tbl) => tbl.userId.equals(userId) &isNull(tbl.doneAt))
.join([...])
// ... |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
HasanAlqaisi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.equalsgenerates an=in SQL. So if you diddoneAt.equals(null), moor would generatedone_at = NULL. In SQL, comparisons withNULLdon't evaluate to a value, so you can't use that. What you should use isdone_AT IS NULL, for which you can use the isNull function in moor: