更改参数的值 max_execution_time 在里面 php.ini
max_execution_time
php.ini
max_execution_time = 360 ;Execution time in seconds
你可以使用 subquery 和; JOIN
subquery
JOIN
SELECT t1.name, t2.userId , t2.nbr_entries FROM generic t1 JOIN (SELECT userId ,COUNT(*) as nbr_entries FROM info GROUP BY userId) t2 ON t1.userId = t2.userId ORDER BY t2.nbr_entries DESC;