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