【问题标题】:UPDATE sentence using WITH doesn't work in MonetDB使用 WITH 的 UPDATE 语句在 MonetDB 中不起作用
【发布时间】:2021-11-29 18:27:11
【问题描述】:

我在 MonetDB(版本 11.41.11)中有此更新:

with t as (select distinct cod_atc_nl_1 , desc_atc_nl_1 from uruguay.staging_rm_dims where desc_atc_nl_1 is not null order by 1)
update uruguay.staging_rm_dims
set
desc_atc_nl_1 = t.desc_atc_nl_1,
desc_atc_nl_2 = t.desc_atc_nl_1,
desc_atc_nl_3 = t.desc_atc_nl_1,
desc_atc_nl_4 = t.desc_atc_nl_1
where
desc_atc_nl_1 is null
and desc_atc_nl_2 is null
and desc_atc_nl_3 is null
and desc_atc_nl_4 is null
and cod_atc_nl_4 is not null
and cod_atc_nl_1 = t.cod_atc_nl_1;

当我执行这句话时,我得到以下错误:

SQL Error [42S22]: SELECT: no such column 't.cod_atc_nl_1'

sintax 不正确吗?

谢谢。

【问题讨论】:

    标签: monetdb update-statement


    【解决方案1】:

    这是在 11.41.1 版本中修复的问题。 with 关系必须在 from 子句中指定。

    【讨论】:

    • 嗨!你能解释一下如何在 from 子句中指定关系吗?
    猜你喜欢
    • 2021-05-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多