我的目标是从一个CTE中选择结果,并在同一程序中使用另一个CTE插入到其他表中.怎么做?
我的错误是......
无效的对象名称xy.
我的疑问是
WITH ds
(
Select a, b, c
from test1
),
xy
(
select d, e, f
from test2
where (uses conditions from ds)
)
Select *
from ds (the result set of ds, am exporting this to csv)
Insert into AuditTest
(
Select * from xy
)
Run Code Online (Sandbox Code Playgroud) 我需要在sql表中显示三列的中间值.
例如:对于数据
col1 col2 col3
759 736 773
Run Code Online (Sandbox Code Playgroud)
那么输出应该是759.
最好的方法是什么?