因为我要插入的表已经建好执行select typeId, count(*) as CountType into 你要插入的表 from table group by typeId提示要插入表的对象已经存在?? 难道你不能先创建要插入的表?
insert into 你要插入的表 select typeId, count(*) as CountType from table group by typeId
如果表不存在就用 select * into 表1 from 表2 --这样的话,系统自动建表如果表存在 insert into 表1 select * from 表2
insert 你要插入的表(字段1,字段2) select typeId, count(*) as CountType from table group by typeId
1,create table tab11(ID char(4),saledate char(7),quantity int) insert tab11 select '1001', '2004011', 200 union all select '1002', '2004011', 120 union all select '1003', '2004011', 150 union all select 2,insert into t (studentID,city,province,delflag) select * from p111 where delflag=1 and province='hubei' update t set t.delflag=0 3,SELECT * from ( select flowid ,stepid,selfcond from flowstep1 union all select flowid ,stepid,selfcond from flowstep11) as a order by stepid 4,select typeId, count(*) as CountType into 你要插入的表 from table group by typeId 一上是几个例子,看一看
难道你不能先创建要插入的表?
select * into 表1 from 表2 --这样的话,系统自动建表如果表存在
insert into 表1 select * from 表2
insert tab11 select
'1001', '2004011', 200 union all select
'1002', '2004011', 120 union all select
'1003', '2004011', 150 union all select
2,insert into t (studentID,city,province,delflag) select * from p111
where delflag=1 and province='hubei'
update t set t.delflag=0
3,SELECT * from (
select flowid ,stepid,selfcond from flowstep1
union all
select flowid ,stepid,selfcond from flowstep11) as a
order by stepid
4,select typeId, count(*) as CountType into 你要插入的表 from table group by typeId
一上是几个例子,看一看