由于计算的需要,使用 with as 建立了四个临时表。
伪代码如下:
with a as (select...),b as (select...),c as (select...),d as(select...)
insert into d
select ....
from a join b on ...
join c on ....
join d on...
执行报错,错误代码 1064 ,说是 insert into 有问题。但是,我先执行以下代码
with a as (select...),b as (select...),c as (select...),d as(select...)
select ....
from a join b on ...
join c on ....
join d on...
然后将查询结果复制为 insert 语句( navicat 的功能),再插入表 d ,就可以成功。
迷惑,求大佬解答。
1
zzzain46 OP 第一段 sql 笔误,insert into d 应为 insert into e
|
2
zzzain46 OP 由于计算的需要,使用 with as 建立了四个临时表。
伪代码如下: with a as (select...),b as (select...),c as (select...),d as(select...) insert into e select .... from a join b on ... join c on .... join d on... 执行报错,错误代码 1064 ,说是 insert into 有问题。但是,我先执行以下代码 with a as (select...),b as (select...),c as (select...),d as(select...) select .... from a join b on ... join c on .... join d on... 然后将查询结果复制为 insert 语句( navicat 的功能),再插入表 e ,就可以成功。 迷惑,求大佬解答。 |
3
bluekz 2022-01-13 16:39:20 +08:00
1064 基本就是 sql 写的有问题。
|