交叉表查询和指定选择标准 [英] Crosstab Query and Specifying Selection Criteria
问题描述
我有一个基本的交叉表查询,用于计算数据中心中每种类型的服务器设备的模型。我正在尝试做的是限制交叉表查询返回小于特定数字的设备的计数....例如100为例。
所以我想要我的查询以显示有101个或更多的服务器模型。
这是SQL语句。
TRANSFORM计数(DEVICE_SPECS.DEVID)AS CountOfDEVID
SELECT DEVICE_SPECS.MFR,ACTIVE_GRID_LOCATIONS.SITE_CODE
来自DEVICE_SPECS内部联接(ACTIVE_GRID_LOCATIONS INNER JOIN设备ON ON ACTIVE_GRID_LOCATIONS.GRIDID = Device.GRIDID)ON DEVICE_SPECS.DEVID = Device.DEVID
WHERE(((ACTIVE_GRID_LOCATIONS.SITE_CODE)=" 12h" Or(ACTIVE_GRID_LOCATIONS.SITE_CODE)=" 9h")AND((DEVICE_SPECS.MFR)=" sun")AND((Device .Disposition)喜欢act *))
GROUP BY DEVICE_SPECS.MFR,ACTIVE_GRID_LOCATIONS.SITE_CODE,Device.Disposition
PIVOT DEVICE_SPECS。[设备类型];
我该怎么做?我不能把条件放在Criteria线上,所以我感觉被困住了。
先谢谢了,
-Frank
I have a basic crosstab queries that counts the models of each type of server device in a data center. What I''m trying to do is restrict the crosstab query from returning counts for devices that are less than a specifc number....say 100 for exampe.
So I want my query to display server models where there are 101 or more.
Here is SQL statement.
TRANSFORM Count(DEVICE_SPECS.DEVID) AS CountOfDEVID
SELECT DEVICE_SPECS.MFR, ACTIVE_GRID_LOCATIONS.SITE_CODE
FROM DEVICE_SPECS INNER JOIN (ACTIVE_GRID_LOCATIONS INNER JOIN Device ON ACTIVE_GRID_LOCATIONS.GRIDID = Device.GRIDID) ON DEVICE_SPECS.DEVID = Device.DEVID
WHERE (((ACTIVE_GRID_LOCATIONS.SITE_CODE)="12h" Or (ACTIVE_GRID_LOCATIONS.SITE_CODE)="9h") AND ((DEVICE_SPECS.MFR)="sun") AND ((Device.Disposition) Like "act*"))
GROUP BY DEVICE_SPECS.MFR, ACTIVE_GRID_LOCATIONS.SITE_CODE, Device.Disposition
PIVOT DEVICE_SPECS.[Equipment Type];
How can I do this? I can''t place the condition on the Criteria line so I feel stuck and stumped.
Thanks in Advance,
-Frank
推荐答案
Frank
您可以将其置于以下标准:
Frank
You can place it on the criteria as follow:
尝试一下,如果它可以正常工作,那么就干掉我的帖子。
如果没有,请尝试:
Try that, and if it works as you want then simply ignore my post.
If not, try :
试试,然后如果它按你的意愿工作,那么就完全忽略我的帖子。
如果没有,请尝试:
Try that, and if it works as you want then simply ignore my post.
If not, try :
这篇关于交叉表查询和指定选择标准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!