我想把sql查询结果形成一个新的表格,在线等! 我想把sql查询结果形成一个新的表格,例如Income,并存在SQLSERVER数据库里,即在SQLSERVER数据库里能看到Income表格,应该怎么写SQL语句?在线等! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * into Income from tb where ... select * into 表2 from 表1 select into tb from sql查询 我刚才试了,是不是那个新表格Income必须为不存在的表格,如果存在,就存不进去,是不是这样? 如果是这样,应该怎么办?马上给分! if object_id('Income') is not null drop table Incomeselect * into Income from tb where ... 把表格例如Income删除的SQL语句怎么写?不是删除表格中的记录,而是删除整个表格。 存在就存不下,存在就用insert into t select * from t1 表格Income 里的内容是适时更新的,而不是说不存在就写入查询结果,存在就不写入。我需要适时的把查询结果写入到Income里面。 drop table t这是什么问题啊? if object_id('Income') is null select * into Income from tb where ...else insert Income select * from tb where ... if object_id('Income') is null select * into Income from tb where ...else insert Income select * from tb where ... 求助: 数据库路径 创建临时表用##tb1和#tb1的生命周期有什么不同? Sybase可以作为发布服务器吗?请教大家. 取在存储过程中的一个值 sql server 中怎么调用vb编写的dll!!! ■■■SQL选择按日记录 订单表 请帮忙■■■ mysql在select语句中使用ISNULL不能设置默认值 一个安装sql server 2000的问题 急:sqlserver 2005中如何导出数据表中字段的注释信息 这样的需求,合不合理? 复制数据问题 问一个客户端连接数的问题
select * into Income from tb where ...
表格Income 里的内容是适时更新的,而不是说不存在就写入查询结果,存在就不写入。我需要适时的把查询结果写入到Income里面。
这是什么问题啊?
if object_id('Income') is null
select * into Income from tb where ...
else
insert Income select * from tb where ...
select * into Income from tb where ...
else
insert Income select * from tb where ...