草庐IT

resolvedby

全部标签

php - MYSQL 具有总计的不同值

尝试返回已解决工单的所有用户的列表以及他们解决的工单数量。此代码有效,但在while循环内查询似乎是不好的做法。有没有更高效的方法?//Getalluserswhohaveresolvedaticket$stmt=$db->prepare("SELECTDISTINCTresolvedbyFROMtickets");$stmt->execute();while($rows=$stmt->fetch()){$user=$rows['resolvedby'];echo"$user";//Echoeachuser$new=$db->prepare("SELECTcount(resolvedb