在 NexusDB 中,我尝试在变量中创建添加查询结果,然后更新所选项目,然后选择变量
START TRANSACTION;
set result = (SELECT * FROM "some_table" where synced = false);
UPDATE some_table set synced = true where synced = false;
select result;
COMMIT;
NexusDB:Query78696906:查询执行失败:语句错误:无法解析第 4 行第 12 行的标识符“result”
回答:
SELECT * INTO #tmp from some_table where synced is null;
UPDATE some_table set synced = true where synced is null;
select * #tmp;