使我的服务器崩溃的两个请求之一有人知道吗?mysql数据库

41ik7eoe  于 2021-06-19  发布在  Mysql
关注(0)|答案(1)|浏览(262)

第一个请求使我的服务器崩溃(cpu达到100%)

SELECT s.idSinistre
FROM test_apc_sinistres s 
INNER JOIN apc_correspondances c ON c.idLiaison = s.idSinistre AND c.refCategorie = '69.1'
INNER JOIN apc_procedures_taches_sinistres p ON s.idSinistre = p.idSinistre 
INNER JOIN apc_contacts co ON s.idAdb = co.idContact
INNER JOIN apc_parametres_adb pa ON pa.idAdb = co.idContact
WHERE s.refStatut = '62.2' 
GROUP BY s.idSinistre;

select co.Nom, s.idSinistre, count(c.idMessage) as nbMEssage, count(p.id) as nbProc
from test_apc_sinistres s 
inner join apc_correspondances c on c.idLiaison = s.idSinistre and c.refCategorie = '69.1'
inner join apc_procedures_taches_sinistres p on s.idSinistre = p.idSinistre
inner join apc_contacts co on s.idAdb = co.idContact
inner join apc_parametres_adb pa on pa.idAdb = co.idContact
where s.refStatut = '62.2'
group by s.idSinistre;

这两者之间的唯一区别是我选择的数据。有人已经有这个问题了?

djp7away

djp7away1#

只需逐个重新检查您的列,您就会看到除了一列之外,您正在对所有列进行聚合。

相关问题