1、
insert into A([id], ids, [name], type, time)
select [id], null, [name], 'dd', getdate() from B where type='dd'
2、
DECLARE @num int,@i int;
SET @i=0;
SET @num=(select 字段 from 表1 where 条件);
WHILE @i<@num
begin
set @i=@i+1;
insert INTO 表2(字段) SELECT 字段 from 表1 where 条件;
end;
3、
insert into b (column1,datecolumn)
select column1,getdate() from a
目标表table2存在;
Insert into Table2 select * from Table1;
目标表table2不存在;
SELECT * into Table2 from Table1;
学习下,嵌套的select语句吧