with as 可以嵌套使用吗
0
在oracle数据库执行如下sql语句报错:
with tmp2 as(
with tmp1 as (select * from m_com_cust a)
select * from tmp1 t1 where t1.cust_no='3000059547')
select tmp2 t2 where t2.cust_name_en='UNKNOWN'
with tmp2 as(
with tmp1 as (select * from m_com_cust a)
select * from tmp1 t1 where t1.cust_no='3000059547')
select tmp2 t2 where t2.cust_name_en='UNKNOWN'
没有找到相关结果
重要提示:提问者不能发表回复,可以通过评论与回答者沟通,沟通后可以通过编辑功能完善问题描述,以便后续其他人能够更容易理解问题.
2 个回复
悟 - 取是能力,舍是境界 2016-01-27 回答
赞同来自: 小耳朵
With tmp as
(
select 1 abc from dual
)
,tmp2 as
(
select 2 def,abc from tmp
)
select * from tmp2
WITH tmp1
AS ( SELECT *
FROM m_com_cust a
) ,
tmp2
AS ( SELECT *
FROM tmp1 t1
WHERE t1.cust_no = '3000059547'
)
SELECT *
FROM tmp2 t2
WHERE t2.cust_name_en = 'UNKNOWN'
小耳朵 2016-01-27 回答
赞同来自: