貼主的相應于select * into #tt_t1 from t_tempt 只不過t_tempt為( select top 3 shuliang from zxsj_数量 order by sell_time desc ) 查詢的結果
re woyaofengle(清流2号) :这个结果如何看到啊?
select * from #tt_t1 #tt_t1表在temp库中存放
Server: Msg 2714, Level 16, State 6, Line 1 There is already an object named '#tt_top720' in the database.如何解决啊?
把临时表名为#tt_top720 的删掉,再运行
从SQL数据库中,可以找到该临时表
if object_id(tempdb..#tt_t1) is not null Drop table tempdb..#tt_t1 select t_tempt.* into #tt_t1 from ( select top 3 shuliang from zxsj_数量 order by sell_time desc ) t_tempt
临时表建好后表名在在tempdb..sysobjects 表里.
1.select top 3 shuliang from zxsj_数量 order by sell_time desc 取zxsj_数量 表中 最晚出售的3条记录 2。select * into #tt_t1 from ( select top 3 shuliang from zxsj_数量 order by sell_time desc ) t_tempt把1取出的插入临时表#tt_t1 中
只不過t_tempt為( select top 3 shuliang from zxsj_数量 order by sell_time desc ) 查詢的結果
#tt_t1表在temp库中存放
There is already an object named '#tt_top720' in the database.如何解决啊?
Drop table tempdb..#tt_t1
select t_tempt.* into #tt_t1 from
( select top 3 shuliang from zxsj_数量 order by sell_time desc ) t_tempt
取zxsj_数量 表中 最晚出售的3条记录
2。select * into #tt_t1 from
( select top 3 shuliang from zxsj_数量 order by sell_time desc ) t_tempt把1取出的插入临时表#tt_t1 中