An error is returned when you use PHP to perform cascading query on the SQL2000 database. google does not get a clear answer, but in general, it is caused by brute-force memory access. brute-force memory access is generally caused by data overflow. so focus on the SQL script select top 50. nickname, B. userid, sum (B. playtime) as cut from playhistory B inner join users a on B. userid =. userid where B. gdate between '2017-09-24 00:00:00 'and '2017-09-24 23:59:59' group by B. userid,. change nickname order by cut desc to select top 50. nickname, B. userid, cast (sum (B. playtime) as bigint) as cut from playhistory B inner join users a on B. userid =. userid where B. gdate between '2017-09-24 00:00:00 'and '2017-09-24 23:59:59' group by B. userid,. the reason why nickname order by cut desc solves the problem is that PHP does not know the type of the CUT temporary field, so the data type is unclear and overflow is changed to clear instructions.