你好,我有这段代码,用于统计表中存储的所有日子的不同ip地址的访问者数。$con = mysql_connect("localhost", "root", "root") or die(mysql_error());
mysql_select_db("visitorsCount$page.'\' group by date order by date';
我有一个inventory表,其中包含一个按LocGroup分组的运行数量列,如图1所示 ? 我想要获取每天的总库存,然后查看最终结果图2。我已经创建了可以工作的代码,但是当我在100,000+记录上运行时,它真的很慢,有没有更好的方法来做到这一点?我猜目前的方法很慢,因为b.EntryDate <= a.EntryDate每次都在求和。我当前的代码: with cte_1 -- Get Total Stock Position not Grouped
a