|
本帖最后由 isyuan 于 2013-2-4 15:53 编辑
查询一:temp_1- SELECT zyh AS 代码,zymc AS 名称 FROM DSPEC
- UNION (SELECT Lbh,Lbmc FROM NPROFF
- UNION SELECT Xdh,Xdmc FROM XD);
复制代码 查询二:temp_2,调用了已经存在的temp_1- SELECT Difference.Zkzh AS 准考证号码, Difference.Code AS 报名号, Difference.Name AS 姓名, Difference.FieldName AS 列, IIf(IsNull([temp_1].[名称]),[before],[temp_1].[名称]) AS 以前, IIf(IsNull([temp_1_1].[名称]),[now],[temp_1_1].[名称]) AS 现在
- FROM (Difference LEFT JOIN temp_1 ON Difference.Before = temp_1.代码) LEFT JOIN temp_1 AS temp_1_1 ON Difference.[Now] = temp_1_1.代码
- ORDER BY Difference.Zkzh;
复制代码 求解:把二个查询合并,用一个查询实现。
附实例下载。谢谢!
该问题困扰我多天了。
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|