本文介绍了交叉表查询和指定选择标准的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我有一个基本的交叉表查询,用于计算数据中心中每种类型的服务器设备的模型。我正在尝试做的是限制交叉表查询返回小于特定数字的设备的计数....例如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 CountOfDEVIDSELECT DEVICE_SPECS.MFR, ACTIVE_GRID_LOCATIONS.SITE_CODEFROM DEVICE_SPECS INNER JOIN (ACTIVE_GRID_LOCATIONS INNER JOIN Device ON ACTIVE_GRID_LOCATIONS.GRIDID = Device.GRIDID) ON DEVICE_SPECS.DEVID = Device.DEVIDWHERE (((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.DispositionPIVOT 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推荐答案 展开 | 选择 | Wrap | Line数字 展开 | 选择 | Wrap | 行号 展开 | 选择 | 换行 | 行号 这篇关于交叉表查询和指定选择标准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-15 15:14