~~I am getting this error while using a complex SQL statement in wrangler D1 "D1_ERROR: A prepared

I am getting this error while using a complex SQL statement in wrangler D1 "D1_ERROR: A prepared SQL statement must contain only one statement." Solved: The ; at the end of the SQL statement was breaking it My statement looks like:
let sql_query = "SELECT *
FROM table_name
WHERE id = ?
AND timestamp > (
SELECT MAX(timestamp)
FROM table_name
);"
let sql_query = "SELECT *
FROM table_name
WHERE id = ?
AND timestamp > (
SELECT MAX(timestamp)
FROM table_name
);"
Can I not use combined statements?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?