SELECT INTO 和 INSERT INTO SELECT 两种表复制语句

select * into #tt1 from  (SELECT *
FROM  (
           SELECT *
           FROM   Table_分类数据_供货_201609 gh
           WHERE  day(gh.G_Time) = 01
                  AND gh.G_JSiteId = 1000
                  AND gh.G_GSiteId = 1004
       ) ghx
       right JOIN (
                SELECT *
                FROM   Table_分类数据_进货_201609 jh
                WHERE  day(jh.J_Time) = 01
                       AND Jh.J_JSiteId = 1000
                       AND jh.J_GSiteId = 1004
            ) jhx
            ON  ghx.G_OrderId = jhx.J_OrderId) xx

参考资料:

http://www.cnblogs.com/freshman0216/archive/2008/08/15/1268316.html

http://www.cnblogs.com/daniel206/archive/2008/01/16/1041748.html

http://wenku.baidu.com/link?url=uo7ZfcfsRm-vsPCskVABo-8qQcvh9EQcnNExVwxsL00bnrR6ps6zTImThCq4hGDdVvWTmQpb5MDzAfZHfU6_XUEqB3uXwnjGRKTvh-sllCm

posted @ 2016-10-26 11:27  李华丽  阅读(250)  评论(0编辑  收藏  举报
AmazingCounters.com