当前位置: 代码迷 >> Sql Server >> [急救]高手们快进来尖叫.该怎么解决
  详细解决方案

[急救]高手们快进来尖叫.该怎么解决

热度:357   发布时间:2016-04-27 16:29:26.0
[急救]高手们快进来尖叫.
我想把一个表查询出来的记录插入到另外一个表里面进去.同一个数据库.
insert   into   test   values(select   top   8000     Content   from   PE_Article   where   ArticleID   not   in   (select   top   10731   ArticleID   from   PE_Article))

这样的话只能是插入一条记录,请问还有没有别的方法..

Content表                       插入到                     test表                                      
查询出来的                                                   Content字段
数据是8000

------解决方案--------------------
select top 8000 Content into test from PE_Article
where ArticleID not in
(select top 10731 ArticleID from PE_Article)
------解决方案--------------------
insert into test select top 8000 Content from PE_Article
where ArticleID not in
(select top 10731 ArticleID from PE_Article)

------解决方案--------------------
--最好帶上字段
insert into test(Content)
select top 8000 Content into test from PE_Article
where ArticleID not in
(select top 10731 ArticleID from PE_Article)
  相关解决方案