比如:
select ... from (
with a as (select * from b)
select ... from a
union all
select ... from c
)d
如果不能,那怎么将
select .... from a
这个查询结果作为嵌套的子查询
带with的子查询没问题,但是前面再用select后就报错
sql sever 好像不行,你试一下用两个with as 查询:
with a as (select * from b),
c as (select * from d)
select * from a join c on a.col=c.col
https://blog.csdn.net/smartsmile2012/article/details/53260752你看一下这个博文,看看对你是否有帮助
可以
select * from (
with a as (select 1 from dual)
select * from a
select 2 from dual
你直接
with tempName as (select ....) select * from tempName
就行了,目前这种用法支持hana,oracle,sqlserver,不支持mysql
你是oracle的么,oracle的没有问题