求一sql语句 怎样把一表中的部分数据存放入一新表中?select * into newtable from oldtable where .... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 --建立测试环境Create Table oldtable(id Int Identity(1,1), bonus Int)--插入数据Insert oldtable Values(89)Insert oldtable Values(97)Insert oldtable Values(83)Insert oldtable Values(94)Insert oldtable Values(83)--测试select * into newtable from oldtablewhere id>3drop table oldtable,newtable 如果新表存在:insert 新表(字段1,字段2........)select 字段1,字段2......from 表where ........如果新表不存在:select 字段1,字段2.........into 新表from 表where ........ 问下什么是执行计划 同一个表的行数据 UPDATE 请教关于SQL 2008 R2版的协同工作的方案 SQL 2005当作业失败时,如何发送MAIL通知? 更改启动时的用户名SA 如何转换成符合IN 字句的字符串? 求一条sql语句~~~~ VB 报表问题 我们讨论一下MS SQL Server和Oracle在StoreProcedure不同吧 求一个SQL查询语句 请问这样的数据如何设计表结构较好。请各位帮忙。多谢! 求助:行变列的时候由于数据库种记录太多,动态sql语句长度超过8000,十分感谢!
--建立测试环境
Create Table oldtable
(id Int Identity(1,1),
bonus Int)
--插入数据
Insert oldtable Values(89)
Insert oldtable Values(97)
Insert oldtable Values(83)
Insert oldtable Values(94)
Insert oldtable Values(83)
--测试
select * into newtable from oldtable
where id>3drop table oldtable,newtable
insert 新表(字段1,字段2........)
select 字段1,字段2......
from 表
where ........如果新表不存在:
select 字段1,字段2.........
into 新表
from 表
where ........