大家新年好!我这里有个SQL语句的优化想向各位大大请教一下现在手头上有个类似下面的一张表.大概是几百万行有的是一个ID一条记录,有的同样id有很多条记录数据列大概有150多个下面举个例子我现在要把同样的itemid item.并计算出revenue margin freight和qty的总值目前我用的语句性能比较低下,不知道有没有什么比较好的方法可以优化一下.select itemid,item,sum(revenue),sum(margin),sum(freight),sum(qty) where table group by item, itemiditemID item revenue margin freight local qty
123 mouse 100 10 0 BJ 100
123 mouse 0 0 20 GZ 0多谢指教.
123 mouse 100 10 0 BJ 100
123 mouse 0 0 20 GZ 0多谢指教.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货