sql - 我的查询需要超过 30 分钟,即使它会显示结果也不确定
问题描述
下面给出的是查询:
SELECT
states.name,
equipment.type,
sum(equipment_events.total),
(SUM(equipment_locations.amount) - SUM(equipment_events.total))
FROM
States,
Locations,
Equipment_locations,
equipment,
equipment_events,
events
WHERE
equipment.id = equipment_events.equipment_id
and states.id = locations.state_id
and locations.id = events.location_id
and equipment.id = equipment_events.equipment_id
GROUP BY
states.name;
解决方案
推荐阅读
- javascript - 如何使一个表的列宽始终与另一表的相应列宽匹配?
- javascript - 如何将结果从 $uibModal 返回到父控制器
- java - Apache POI 如何输出为 .xlsx
- javascript - 单击表单链接时,Asp.net Webform 加载两次?
- machine-learning - 来自 Google 新闻 Word2Vec 模型的小模型
- ajax - 带有 ajax 选项卡的砌体
- oauth-2.0 - OAuth 交换给出 invalid_grant 和 Bad request
- r - R中的PosixCT转换失败
- css - 编辑 Angular 材质的表格单元格填充
- c# - 关于Windows Server 2016的IIS上的ASP.NET MVC3 Web应用部署