I am trying to use the SELECT TOP 1 * FROM tasks WHERE dueDate < ?1 ORDER BY dueDate DESC , but SQLite says near "1": syntax error . What's wrong?
SELECT TOP 1 * FROM tasks WHERE dueDate < ?1 ORDER BY dueDate DESC
near "1": syntax error
Use LIMIT 1 at the end of the query instead of TOP 1 (which sqlite syntax is not valid).
LIMIT 1
TOP 1
You may also need to remove ? in dueDate < ?1 , but I donβt know sqlite well enough to be sure.
?
dueDate < ?1