Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Limit and offset in Sqlite update statmet

Tags:

sqlite

update table set column_name limit 3 offset 2;

The above query is not working.

Throws error

sql error: syntax error near 'limit'.

like image 343
arunprasadmp Avatar asked Nov 26 '25 07:11

arunprasadmp


1 Answers

An UPDATE statement expects a new value after the column_name, like this:

update thetable set column_name = 'some new value'

Furthermore, the documentation mentions that you need to have compiled SQLite with the SQLITE_ENABLE_UPDATE_DELETE_LIMIT option, which is not enabled by default.

like image 64
CL. Avatar answered Nov 28 '25 16:11

CL.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!