impala with as
impala with as 语法与oracle略有不同(主要是符号方面)
with x as (select 1), y as (select 2) (select * from x union y)
如果是一个表with as
with x as
(select 1)
(select * from x)
注意(select 1)后面没有逗号
select * from x必须用括号。
with as是创建一个inline view
20210927补充:
创建的view非常占用服务器的memory,而且跑一次后memory要过大概10分钟才会释放出来,从这个角度讲,临时表似乎更好一些
留言
張貼留言