我的问题是,当我执行select命令时,应用程序非常慢,因为我执行select from table时有10000条记录,但我总是只处理大约前100条记录。是否有选项说Doselect,但不是从所有表中选择-例如。是否从表中选择,但仅处理前100条记录?
$time = mysql_query("KBD, jobNumber, truckid, SUM(pallets) as count_pallets, SUM(cartons) as count_cartons, COUNT(*) as pocet FROM incoming WHERE availableDate = '$today_date' AND slotTime = '$time' GROUP BY truckid,forwarder");
1条答案
按热度按时间34gzjxbg1#
您可以通过在末尾添加limit子句来限制mysql中的记录数量。