gpt4 book ai didi

sql - 基于带有 'WITH'子句的SELECT的 View

转载 作者:行者123 更新时间:2023-12-04 21:59:51 25 4
gpt4 key购买 nike

我选择了'WITH'子句:

with 
alias1 as (select...),
alias2 as (select ... from alias1),
alias3 as (select col1, col2 ... from alias2)
select col1,col2 from alias3

我尝试使用以下方法创建 View :
create view ex_view as (
with
alias1 as (select...),
alias2 as (select ... from alias1),
alias3 as (select col1, col2 ... from alias2)
select col1,col2
from alias3
)

当我尝试执行此create语句时,“不支持使用WITH子句”

如何适本地基于我的选择语句创建 View ?

最佳答案

尝试删除括号:

create view ex_view as
with
alias1 as (select...),
alias2 as (select ... from alias1),
alias3 as (select col1, col2 ... from alias2)
from alias3;

关于sql - 基于带有 'WITH'子句的SELECT的 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27901751/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com