【问题标题】:NexusDB declare and set table result in a variable and select itNexusDB 在变量中声明并设置表结果并选择它
【发布时间】:2018-01-12 15:27:22
【问题描述】:

在 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;

【问题讨论】:

    标签: nexusdb


    【解决方案1】:

    “选择结果”是语法错误。 NexusDB 期望您从中选择;在这种情况下,您可以使用内置的#dummy 表来实现此目的。所以:

    从 #dummy 中选择结果

    【讨论】:

      猜你喜欢
      • 2021-03-09
      • 1970-01-01
      • 2011-12-06
      • 2012-08-05
      • 1970-01-01
      • 2020-09-20
      • 1970-01-01
      • 2018-08-31
      • 2013-12-29
      相关资源
      最近更新 更多