发布网友 发布时间:2022-04-25 21:09
共1个回答
热心网友 时间:2022-04-08 12:50
完全COPY另一张表
create
table
aa
as
select
*
from
and05
将结果集的数据插入到某表中
insert
into
and07(cnd215,cnd224,cnd222,cnd225)
select
z.cnd215,sysdate,
(select
sum(cnd037)
from
and02
a
where
a.cnd032='20002901'
and
a.cnd215=z.cnd215)
A,
(select
sum(cnd037)
from
and02
a
where
a.cnd032='20002902'
and
a.cnd215=z.cnd215)
B
from
and02
z
where
trunc(cne007,'mm')
=
trunc(sysdate,'mm')
group
by
cnd215
针对“完全COPY另一张表”的演练
truncate
table
aa
insert
into
aa
select
*
from
and05;
用另一个表的结果去更新某张表
update
and02
a
set
a.and07id=(select
b.and07id
from
and07
b
where
a.cnd215=b.cnd215
and
trunc(cnd224,'mm')=trunc(sysdate,'mm'));