本文介绍了如何在MakeTable查询-Access 2000中添加虚拟行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这张照片:
如您所见,字段"promet"可以从1到9.但是对于tipprod ="02",promet的值为1、2、3、5和7.
As you can see the field "promet" can go from 1 to 9. However for tipprod = "02" promet has values of 1, 2, 3, 5 and 7.
我想为缺少的promet,4、6、8和9值添加虚拟行,并为tipprod的其他值添加虚拟行,例如"03"或"04"等...
I want to add dummy rows for missing values of promet, 4, 6, 8 and 9, and I want to do it for other values of tipprod, like "03" for example or "04" etc...
这是我的查询示例,其中删除了一些列:
Here is an example of my query with some columns removed:
我该怎么做?
推荐答案
寻求纯SQL答案:
首先,创建一个返回虚拟变量的查询:
First, create a query that returns the dummy variables:
SELECT A.tipprod, B.promet
FROM
(SELECT DISTINCT tipprod FROM T11_nezbirni) AS A, (SELECT DISTINCT promet FROM T11_nezbirni) AS B
然后将剩下的查询与tipprod和promet上的查询连接起来
And then just left join the rest of your query to that on tipprod and promet
这篇关于如何在MakeTable查询-Access 2000中添加虚拟行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!