具有分组依据和条件的MS Access Union查询

时间:2015-08-24 19:09:45

标签: sql ms-access ms-access-2010

我有以下查询,需要与另一个具有完全相同字段的表进行联合。但是,标准可以跨越两个表中的信息。

关于如何与小组和标准结合的任何想法?

SELECT sporderpipeline.coordinator, 
       sporderpipeline.[update date], 
       Count(sporderpipeline.loan_number) AS CountOfLoan_Number, 
       sporderpipeline.[data source] 
FROM   sporderpipeline 
GROUP  BY sporderpipeline.coordinator, 
          sporderpipeline.[update date], 
          sporderpipeline.status, 
          sporderpipeline.[data source] 
HAVING ( ( ( sporderpipeline.[update date] ) BETWEEN #8/23/2015# AND #8/24/2015# 
         ) 
         AND ( ( sporderpipeline.status ) IS NOT NULL ) ); 

1 个答案:

答案 0 :(得分:0)

创建随播广告查询。我们称之为MyQuery_Second

SELECT * FROM MyQuery_First UNION SELECT * FROM MyQuery_Second;

......甚至可能......

MyQuery_First UNION MyQuery_Second;

它应该可以正常工作。