NexusDB在变量中声明并设置表结果并选择它

时间:2018-01-12 15:27:22

标签: nexusdb

在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行,pos 12

的标识符“result”

答案:

 SELECT * INTO #tmp from some_table where synced is null;
 UPDATE some_table set synced = true where synced is null;
 select * #tmp;

1 个答案:

答案 0 :(得分:1)

“select result”是语法错误。 NexusDB希望您从某些内容中进行选择;在这种情况下,您可以使用内置的#dummy表来实现此目的。所以:

SELECT结果来自#dummy