【发布时间】:2018-04-14 15:22:44
【问题描述】:
如何在 SQLite 的 UPDATE 中使用 LIMIT 子句?
我尝试将选项添加到 SQLConnection 但它不起作用,我收到错误 SQL logic error near LIMIT
SQLiteConnection connection = new SQLiteConnection("Data Source=" + outpath + ";Version=3;foreign keys=true;sqlite enable update delete limit=true");
string sql = @"
UPDATE MyTable
SET userId = @userId2
WHERE userId = @userId1
LIMIT @amount
";
如果无法使LIMIT 子句起作用,我还能如何限制更新的记录数量?
【问题讨论】:
标签: c# sql system.data.sqlite