document.write(""); select Term, count(Term) as tcount from PPC_SearchStatistics where 1=1 group by Term order by tcount desc limit 0,10
The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay