这是SQL由于需要将一对多的值,把多的值合并成一个字段,现在已经完成了第一个合并,这个sql还需要在关联一个一对多的表,如何再套一个with呢?我再套一个with之后就报错了
with 不能套with
把主要的sql 用with
然后用这个主表关联查询其他表
把with tlb as删了
正确的写法应该是:
with A as (select * from table)
,B as (select * from A)
select * from B
没有这种语法,子查询嵌套可以这样写
With a as (Select ... From ...),
b as (Select ... From a),
c as (Select ... From b)
Select ... From c