將所查詢到的資料放進暫存table再union

发表于:2007-06-07来源:作者:点击数: 标签:
(select resak.resak001,resak.resak002,resak.resak005,resak.resak006, resal.resal001 AS E XP R3, resak.resak015 AS EXPR4, resal.resal002 into tempTable FROM resak INNER JOIN resal ON resak.resak015 = resal.resal001 where resak.resak005='sil

(select resak.resak001,resak.resak002,resak.resak005,resak.resak006, resal.resal001 AS EXPR3, resak.resak015 AS EXPR4, resal.resal002 
into tempTable FROM             resak INNER JOIN
                          resal ON resak.resak015 = resal.resal001

where resak.resak005='silvia_tsai.nettrade.com.tw' and resak.resak001!='9999' and resak.resak001 !='1947')

select MV001,MV002,MV021,MV022 into tempTableFromCMSMV from [172.16.200.81].Leader.dbo.CMSMV

select * from tempTable
select * from tempTableFromCMSMV

select tempTable.resak001,tempTable.resak002,tempTableFromCMSMV.MV021,tempTableFromCMSMV.MV022

FROM            tempTable INNER JOIN
                         tempTableFromCMSMV ON  tempTable.resak001 = tempTableFromCMSMV.MV001

原文转自:http://www.ltesting.net