我在使用以下代码时确实遇到了困难,我找不到将插入语句放置在该代码中的何处,它将插入来自 CTE 的返回值。
insert into ntm (num,comb,0,0,0,0,0,0,0,0,0,0,0,0)
with CTE as (
SELECT a.ELM_NUM as num,
a.N_1 as N1,
(trim('1.4*'||a.COMBO)||' + ' || '1.6*'||b.COMBO) as com2,
b.ELM_NUM as num2
FROM NTM a cross join ntm b
where ((a.Combo='dead' and b.combo='live') or (a.Combo='dead' and b.combo='live')) and a.ELM_NUM=b.ELM_NUM)
select num, num2, trim(trim(com2)||' + '||trim(d.combo)), N1, 1.4*N1
from CTE cross join ntm d
where (d.elm_num = cte.num) and (position('X',combo)>0 or position('Y',combo)>0 )
FlameRobin 引擎引发的错误“令牌未知 - 第 1 行,第 27 0 列
CREATE TABLE NTM
(
ELM_NUM Integer NOT NULL,
COMBO Char(40) NOT NULL,
N_1 Double precision,
N_2 Double precision,
V2_1 Double precision,
V2_2 Double precision,
V3_1 Double precision,
V3_2 Double precision,
M2_1 Double precision,
M2_2 Double precision,
M3_1 Double precision,
M3_2 Double precision,
MT_1 Double precision,
MT_2 Double precision
);